|
Christian Graus wrote:
Just to clean this code up a little.....
Christian Graus wrote:
And why did you use all of namespace std and then scope it explicitly as well ???
Again, . I was just typing something up quickly, thanks for pointing out some corrections.
Christian Graus wrote:
// you can close it if you like, but being a C++ class, it will do it itself when it goes out of scope.
I do this just out of practice, no other reason because it doesn't hurt.
Nick Parker
|
|
|
|
|
Nick Parker wrote:
I do this just out of practice, no other reason because it doesn't hurt.
You're not wrong. I am in the habit of NOT doing it when I write something quick and dirty. Guess what you need to do to file objects in C# ?
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
thank you very much, too.
lucky
|
|
|
|
|
thank you very much!!!
lucky
|
|
|
|
|
thanks
|
|
|
|
|
Yes - you hit compile
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
then i get an exe - machine code. not assembly code...
|
|
|
|
|
You can trace into a release build, I believe, and see the assembler. Otherwise, the answer is no.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
I'm using Visual studio .Net now, but I'm pretty sure this is also available in VC6. Under project settings for C/C++ there is an output file section where you can specify to have it output an assembly source listing when building your project.
- Anatari
|
|
|
|
|
Hello,
I have a pop-up menu open when the user right clicks the status bar.. I would like to display the pop-up menu only if the right button up is right over the status bar text (not just anywhere on the status bar).. How could I go about capturing the text area as a CPoint?
Thanks,
Rob
|
|
|
|
|
I write these below program to draw a rectangle which have black frame. In the rectangle have 4 red points and I draw the line between 2 point. So I get the result as this picture
http://www.geocities.com/ooosawaddee3/pic/PointPicture.jpg
In the picture the red point is very small and the line between point is not exactly straight. I want the larger red point and straight line. Do you know how to do that?
pDC->SetMapMode(MM_TEXT);<br />
<br />
pDC->FillSolidRect(origin.x, origin.y, 2000, 2000, RGB(255,255,255));<br />
<br />
int cx = 5;<br />
int cy = 5; <br />
<br />
CPen pen, pen2;<br />
pen.CreatePen(PS_SOLID,2, RGB(0,0,0));<br />
<br />
pDC->SelectObject(&pen);<br />
<br />
pDC->Rectangle(cx,cy,(cx +256), (cy + 192));<br />
pDC->SetPixel(45,10, RGB(255,0,0));<br />
pDC->SetPixel(47,9, RGB(255,0,0));<br />
pDC->SetPixel(79,45, RGB(255,0,0));<br />
pDC->SetPixel(46,120, RGB(255,0,0));<br />
<br />
pen2.CreatePen(PS_SOLID,1, RGB(0,0,255));<br />
<br />
pDC->SelectObject(&pen2);<br />
pDC->MoveTo(45,10);<br />
pDC->LineTo(79,45);
|
|
|
|
|
The image link is 404.
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
ooosawaddee3 wrote:
pDC->SelectObject(&pen2);
pDC->MoveTo(45,10);
pDC->LineTo(79,45);
This won't draw a straight line, for a straight line, either the x or y needs to stay the same.
Your rectangle is straight - it has to be.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
hi, just want to capture WM_KEYDOWN for my editbox. yes, it doesnt support WM_KEYDOWN...
so, i guess the only way for this to work is to subclass a editbox control, inherit from both editbox and dialog class?
is this feasible? is there better alternative?
thanks a bunch.
norm
|
|
|
|
|
Hi..
1. Subclass CEdit class. Say CMyEdit.
2. Now map the message WM_GETDLGCODE (OnGetDlgCode())
3. Return DLGC_WANTALLKEYS for the mapped function.
4. Now u will get the key down messages.
Regards,
Rejeesh
|
|
|
|
|
class TaskInfoBase {
....
virtual void setSize(int) = 0;
};
class NewTaskInfo : public TaskInfoBase {
NewTaskInfo() { InitializeCriticalSection(&m_cs); }
~NewTaskInfo() { DeleteCriticalSection(&m_cs); }
void setSize(int);
static CRITICAL_SECTION m_cs;
};
class NewTask : public NewTaskInfo, pubic NewTaskBase {
};
class HttpDownload : public DownData , public CHttpDown {
public:
HttpDownload():NewTaskInfo() {}
void write();
NewTask *m_pTask;
};
//******************************************************************************
// Implement
CRITICAL_SECTION NewTaskInfo::m_cs;
void NewTaskInfo::setSize(int i)
{
EnterCriticalSection(&m_cs); // Exception here .
m_nSize = i;
LeaveCriticalSection(&m_cs);
}
void HttpDown::write()
{
....
m_pTask->setSize(20002); // Enter NewTaskInfo::setSize();
}
|
|
|
|
|
I would guess that the m_pTask pointer doesn't point to a valid NewTaskInfo object. If that's the case, the this pointer on entry to the setSize function isn't valid, and the resulting m_cs member passed to the EnterCriticalSection function doesn't represent a valid critical section.
Software Zen: delete this;
|
|
|
|
|
I cannot remember how to implement the code in a program that I am writing over here, to check the machine to see if the correct amount of RAM is installed and available in order for my program to run.
Basically, what I am after is something such as this:
1. To check to see if there is enough memory for my program to run.
2. If there is not enough memory available, or installed for it to return with an error saying, "not enough memory, please upgrade your memory or close existing applications that are running".
3. Then close if the program can not be initialized.
I've done this with I believe, 7 lines of code previously. I am using Visual C++ 6.0 and Visual C++ .NET; rarely Visual C++ 4.0 -- but I think this could be used on all three of these suites.
I would greatly appreciate any help and response to this message and helping me out with my problem.
|
|
|
|
|
Try
GlobalMemoryStatus()
or
GlobalMemoryStatusEx()
Gero
|
|
|
|
|
I'm looking for something more along the lines of having the program check to see if there is a certain amount of RAM available, say I want the program to have 64 MB of ram available for it to run, it will -- otherwise, anything lesser it would terminate. I would like this to be hard coded; but I cannot remember it though. I'll check out what you sent me and see what I can get out of that.
|
|
|
|
|
The MEMORYSTATUS structure you pass to GlobalMemoryStatus() contains dwTotalPhys and dwAvailPhys. dwTotalPhys contains the total amount of physical RAM and dwAvailPhys should contain the amount of FREE physical RAM. You can also use dwMemoryLoad to query the memory load in percent.
Hope this helps,
Gero
|
|
|
|
|
i am writing a small program that uninstall a com server i wrote earlier.
cleaning the registry is no problem. The problem lies in the start menu. One item on my application's start menu is "Uninstall.exe".
launch "Uninstall.exe" cleans the registry. But how can it delete itself to remove all items from start menu?
do i have to put uninstall in a different directory besides start menu?
thanks.
norm
|
|
|
|
|
|
does "InstallShield" does UN-installation for you? I did read up a little on InstallShield. Didnt know that it does uninstallation for u...
I figured it's pretty simple matter of registering a server, a few entries in registry and copying a few files to the client machines.
anyway, INstallation is done.
It's UN-installation where i'm having problem now.
Thanks.
norm
|
|
|
|
|
|