Click here to Skip to main content
15,942,672 members
Home / Discussions / Managed C++/CLI
   

Managed C++/CLI

 
GeneralRe: Using unmanaged libraries in C++/CLI applications Pin
Bartosz Bien30-Nov-06 12:25
Bartosz Bien30-Nov-06 12:25 
QuestionMagic Square Code Pin
XFluid20-Nov-06 1:36
XFluid20-Nov-06 1:36 
AnswerRe: Magic Square Code Pin
XFluid20-Nov-06 1:43
XFluid20-Nov-06 1:43 
GeneralRe: Magic Square Code Pin
Paul Conrad20-Nov-06 20:32
professionalPaul Conrad20-Nov-06 20:32 
AnswerRe: Magic Square Code Pin
XFluid20-Nov-06 2:03
XFluid20-Nov-06 2:03 
GeneralRe: Magic Square Code Pin
Christian Graus20-Nov-06 9:19
protectorChristian Graus20-Nov-06 9:19 
GeneralRe: Magic Square Code Pin
led mike20-Nov-06 9:30
led mike20-Nov-06 9:30 
QuestionMemory Leak Pin
BarneyGRubble19-Nov-06 13:58
BarneyGRubble19-Nov-06 13:58 
I have a fairly big memory leak involving inherited classes.

The base class is a generic visual component which has data members used to create a basic window. The next class up is a generic Edit Window with no data members (it justs set values from the base class). The 3rd class in the heirachy is an simple Edit Window which contains data members for a simple edit (similar to the "Edit" class supplied by windows.

I noticed the leak whilst writing a program for work. So I decided to test it out a bit more thoroughly. I ended up with a loop which created and deleted 1000 of these Edit windows. To my horror I had a leak of over 600 bytes! I then tried making the destructors virtual, but this made no difference.

The classes look roughly like this:

AGenericWindow:
{
AGenericWindow();
virtual ~AGenericWindow();

HINSTANCE _hInstance;
HWND _hWnd;
WNDCLASSEX _wndClassEx;
AComponent* _pParent;
char _className[25];
int _resourceId;
};

AGenericEdit
{
AGenericEdit();
virtual ~AGenericEdit();
};

ASimpleEdit
{
ASimpleEdit();
virtual ~ASimpleEdit();

BOOL Disabled;
BOOL Number;
char* Text;
int TextAlign;
int TextLen;
};

I then tried making a fake heirachy which contained data at each level - using the same 1000x loop seems to deallocate all the memory fine!

I'm compliling with Visual C++ 6.0 on Windows XP. If anyone has any suggestions I would be very gratefull indeed!Cry | :((

Barney G Rubble
AnswerRe: Memory Leak Pin
Christian Graus19-Nov-06 14:17
protectorChristian Graus19-Nov-06 14:17 
GeneralRe: Memory Leak Pin
Nemanja Trifunovic20-Nov-06 10:51
Nemanja Trifunovic20-Nov-06 10:51 
Questioncallbacks Pin
snxxxxt17-Nov-06 2:20
snxxxxt17-Nov-06 2:20 
AnswerRe: callbacks Pin
led mike17-Nov-06 6:00
led mike17-Nov-06 6:00 
GeneralRe: callbacks Pin
snxxxxt17-Nov-06 17:41
snxxxxt17-Nov-06 17:41 
GeneralRe: callbacks Pin
led mike20-Nov-06 11:04
led mike20-Nov-06 11:04 
Questionhelp me in implementing blowfish Pin
omc7916-Nov-06 9:04
omc7916-Nov-06 9:04 
AnswerRe: help me in implementing blowfish Pin
George L. Jackson16-Nov-06 11:34
George L. Jackson16-Nov-06 11:34 
AnswerRe: help me in implementing blowfish Pin
Christian Graus18-Nov-06 14:19
protectorChristian Graus18-Nov-06 14:19 
QuestionUse C++ to make database application Pin
jingguangdadao16-Nov-06 8:01
jingguangdadao16-Nov-06 8:01 
QuestionRe: Use C++ to make database application Pin
George L. Jackson16-Nov-06 10:50
George L. Jackson16-Nov-06 10:50 
QuestionRe: Use C++ to make database application Pin
jingguangdadao28-Nov-06 1:56
jingguangdadao28-Nov-06 1:56 
GeneralRe: Use C++ to make database application Pin
George L. Jackson28-Nov-06 12:55
George L. Jackson28-Nov-06 12:55 
GeneralRe: Use C++ to make database application Pin
jingguangdadao29-Nov-06 3:55
jingguangdadao29-Nov-06 3:55 
AnswerRe: Use C++ to make database application Pin
Christian Graus18-Nov-06 14:18
protectorChristian Graus18-Nov-06 14:18 
GeneralRe: Use C++ to make database application Pin
jingguangdadao29-Nov-06 3:55
jingguangdadao29-Nov-06 3:55 
GeneralRe: Use C++ to make database application Pin
Christian Graus29-Nov-06 8:37
protectorChristian Graus29-Nov-06 8:37 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.