|
cshah2 wrote: but main thing is wat code shud i write to change the colour
Set the new color in your respective member variable and trigger a redraw
You did draw them before, so erase the screen, redraw, but take the color from the color-member-variable mentioned above).
"We trained hard, but it seemed that every time we were beginning to form up into teams we would be reorganised. I was to learn later in life that we tend to meet any new situation by reorganising: and a wonderful method it can be for creating the illusion of progress, while producing confusion, inefficiency and demoralisation."
-- Caius Petronius, Roman Consul, 66 A.D.
|
|
|
|
|
hi,
i want to know which SP is installed on my machine.
I hav evn implemented that using wmi. It even works
but i want to know, if using wmi is a better option or chking registry is a better option.
If I have a list of the exes KBXXXX then can I chk registry as well ?
I want to know if wmi and chking these registry entries is giving me the same result - that is to let me know that SP2(or whichevr) is installed.
Please help.
|
|
|
|
|
Call GetVersionEx() and pass an OSVERSIONINFOEX struct. You can then check the wServicePackMajor and wServicePackMinor members of the struct.
|
|
|
|
|
Hi all,
I am having a memory leak.
// senario
//To include CGTDObjectShape class
#include "GTDObjectShape.h"
in .h Class
class CGTDSwitchBasic : public CObject
{
public :
CGTDObjectShape *mC_ONShape; // CGTDObjectShape class
CGTDObjectShape *mC_OFFShape; // CGTDObjectShape class
};
in .CPP Class
CGTDSwitchBasic::CGTDSwitchBasic(UINT pui_SwitchDrawObjID)
{
// Create a new Instace of the Object Shape.
mC_ONShape = new CGTDObjectShape(pui_SwitchDrawObjID , 0);
mC_OFFShape = new CGTDObjectShape(pui_SwitchDrawObjID , 1);
}
--> Memory Leak after Closing the Application
GTDSwitchBasic.cpp(70) : {185679} client block at 0x0D732450, subtype c0, 200 bytes long.
//===========================================================================
Please help me out.
Uday kiran
|
|
|
|
|
uday kiran janaswamy wrote: // Create a new Instace of the Object Shape.
mC_ONShape = new CGTDObjectShape(pui_SwitchDrawObjID , 0);
mC_OFFShape = new CGTDObjectShape(pui_SwitchDrawObjID , 1);
Where you have deleted this memory ?
|
|
|
|
|
hi prasad,
//Code Snippet.
//==================================================================
CGTDSwitchBasic::~CGTDSwitchBasic()
{
if(mC_ONShape){
delete mC_ONShape; //Deleted Here
}
if(mC_OFFShape){
delete mC_OFFShape; //Delete Here
}
}
//==================================================================
please give your suggestions.
Uday kiran
|
|
|
|
|
How you are using CGTDSwitchBasic object? If its pointer, probably its not deleted , which inturn causing this leak. Probably , providing more code should do.
uday kiran janaswamy wrote: if(mC_ONShape){
delete mC_ONShape; //Deleted Here
}
There is no harm calling delete on NULL pointer. You can avoid if statement here. Just set pointer to NULL after deleting it.
|
|
|
|
|
uday kiran janaswamy wrote: client block at 0x0D732450
There is an article in MSDN with the following heading
"Detecting and Isolating Memory Leaks Using Microsoft Visual C++"
This artcile will explain to you what are client blocks and normal blocks and how to set breakpoints on allocations.
|
|
|
|
|
uday kiran janaswamy wrote: GTDSwitchBasic.cpp(70) : {185679} client block at 0x0D732450, subtype c0, 200 bytes long.
What is line 70 in your cpp ?
|
|
|
|
|
Hi Prasad,
The Line 70 is
mC_ONShape = new CGTDObjectShape(pui_SwitchDrawObjID , 0); //Line 70.
Please help me out prasad.
Uday kiran
|
|
|
|
|
Does d'tor of CGTDSwitchBasic is getting called ? If CGTDSwitchBasic is created on heap, are you calling delete on it ?
Does c'tor of class CGTDObjectShape does some memory allocation , which is not getting deleted ?
|
|
|
|
|
Hi,
I am trying to execute .bat file using CreateProcess API .
like below
CreateProcess("C:\\WINNT\\system32\\cmd.exe", // lpszImageName
"C:\\Tomcat.bat", // lpszCommandLine
0, // lpsaProcess
0, // lpsaThread
TRUE, // fInheritHandles
CREATE_NO_WINDOW, // fdwCreate
0, // lpvEnvironment
0, // lpszCurDir
&si, // lpsiStartupInfo
&pi // lppiProcInfo
))
But its not working. Can any one help me out in this ?
Thanks and Regards,
Subbu
|
|
|
|
|
Y don't u use ShellExecute(), instead of CreateProcess()?
Come online at:-
jubinc@skype
|
|
|
|
|
I am having lots exe files to execute .. so I will be going in a loop and exexute each exe through CreateProcess. All this process will done in a windows service
|
|
|
|
|
Don Box wrote: Y don't u
May I please ask you to make use of proper language? Saving your key strokes?
toxcct already asked you this, didn't he?
Nobody can give you wiser advice than yourself. - Cicero
ப்ரம்மா
|
|
|
|
|
I had seen a couple of articles on drag and drop between listboxes on the .NET framework IDE whihc uses some very helpful built-in functions. However, I am still on VC 6. Just wondering if it is possible to implement the drag and drop feature? Any clues and suggestions welcomed. Thanks.
|
|
|
|
|
whatever@whatever.com wrote: I am still on VC 6.
Look up CDragListBox .
|
|
|
|
|
CDragListBox allows drag and drop within its own listbox for arrangement purposes but not onto another list box.
|
|
|
|
|
|
Can't really find anything relevant to VC6.
|
|
|
|
|
Really?
Link1[^]
Link2[^]
Nobody can give you wiser advice than yourself. - Cicero
ப்ரம்மா
|
|
|
|
|
Yeah. Thanks for the effort, but I was looking for dragging and dropping from one listbox to another, rather than within the same listbox for arrangement purpose. I guess such a feature is not supported in VC6.
|
|
|
|
|
whatever@whatever.com wrote: I guess such a feature is not supported in VC6
This[^] should given an idea. Drag and drop between listboxes is not intrinsically supported but you can provide this support through coding.
|
|
|
|
|
See this article by Paul DiLascia, from his "C++ Q&A" column in the October 2004 issue of MSDN: "Create Client Windows, Drag and Drop Between Listboxes" at http://msdn.microsoft.com/msdnmag/issues/04/10/CQA/[^]
It explains the coding needed to obtain drag and drop between different list boxes in the same application.
Mike
|
|
|
|
|
Thanks! U made my dae. Also thanks to all others who had given their comments.
|
|
|
|