Click here to Skip to main content
15,919,749 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: MFC Grid Control in CFormView Pin
markkuk31-May-01 20:27
markkuk31-May-01 20:27 
GeneralRe: MFC Grid Control in CFormView Pin
Tomasz Sowinski1-Jun-01 0:37
Tomasz Sowinski1-Jun-01 0:37 
GeneralRe: MFC Grid Control in CFormView Pin
markkuk1-Jun-01 2:07
markkuk1-Jun-01 2:07 
GeneralRe: Grid Control in CFormView Pin
5-Jun-01 22:19
suss5-Jun-01 22:19 
GeneralMSComm produces memory leak Pin
D.D. de Kerf30-May-01 20:40
D.D. de Kerf30-May-01 20:40 
GeneralRe: MSComm produces memory leak Pin
31-May-01 8:02
suss31-May-01 8:02 
GeneralRe: MSComm produces memory leak Pin
D.D. de Kerf31-May-01 21:26
D.D. de Kerf31-May-01 21:26 
GeneralRe: MSComm produces memory leak (the solution!) Pin
D.D. de Kerf6-Jun-01 20:56
D.D. de Kerf6-Jun-01 20:56 
Hello all!!

I've figured out where my memory leak was! It was the way I took the variant out of the GetInput function. Since I've never really been a VB fan I never liked variants anyway, but now I'm truly scared of them Wink | ;)

The code that I used was wrong:
COleVariant var = MSComm1.GetInput();

This code leaves another copy of the variant hanging around inside the memory space of the MSComm object. If your client receives the content of several files, this means a lot of leaking memory.

The solution is as follows:
COleVariant var.Attach (MSComm1.GetInput());

This code explicitly tells the ActiveX component that we want to read the variant type and delete it from the COM-memory space...

Have fun!

Structured programming vs. chaotic mind boggling
GeneralDestructor not being called Pin
Miroslav Rajcic30-May-01 20:08
Miroslav Rajcic30-May-01 20:08 
GeneralRe: Destructor not being called Pin
30-May-01 20:16
suss30-May-01 20:16 
GeneralRe: Destructor not being called Pin
Miroslav Rajcic30-May-01 20:35
Miroslav Rajcic30-May-01 20:35 
GeneralRe: Destructor not being called Pin
Christian Graus30-May-01 20:41
protectorChristian Graus30-May-01 20:41 
GeneralThanks Pin
Miroslav Rajcic30-May-01 20:42
Miroslav Rajcic30-May-01 20:42 
QuestionW2K/multi-CPU overlapped sockets bug? Pin
Taka Muraoka30-May-01 19:45
Taka Muraoka30-May-01 19:45 
QuestionDocking Bar inside a DLL? Pin
Steve The Plant30-May-01 19:12
Steve The Plant30-May-01 19:12 
AnswerRe: Docking Bar inside a DLL? Pin
Tomasz Sowinski31-May-01 0:09
Tomasz Sowinski31-May-01 0:09 
GeneralNegative values in resource.h Pin
Nick Blumhardt30-May-01 14:55
Nick Blumhardt30-May-01 14:55 
GeneralRe: Negative values in resource.h Pin
Christian Graus30-May-01 15:15
protectorChristian Graus30-May-01 15:15 
GeneralCreating Remote Desktop Sharing Software Pin
30-May-01 14:23
suss30-May-01 14:23 
GeneralFrustration with BSTR* Pin
30-May-01 13:47
suss30-May-01 13:47 
GeneralRe: Frustration with BSTR* Pin
Christian Graus30-May-01 13:53
protectorChristian Graus30-May-01 13:53 
GeneralRe: Frustration with BSTR* Pin
30-May-01 14:00
suss30-May-01 14:00 
GeneralRe: Frustration with BSTR* Pin
Christian Graus30-May-01 14:13
protectorChristian Graus30-May-01 14:13 
GeneralTab Control Pin
Craig Phillips30-May-01 13:23
Craig Phillips30-May-01 13:23 
GeneralRe: Tab Control Pin
Christian Graus30-May-01 13:51
protectorChristian Graus30-May-01 13:51 

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.