Click here to Skip to main content
15,890,512 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Out of virtual memory Pin
David Crow9-Mar-04 3:33
David Crow9-Mar-04 3:33 
GeneralRe: Out of virtual memory Pin
martin_j9-Mar-04 3:41
martin_j9-Mar-04 3:41 
GeneralRe: Out of virtual memory Pin
wb9-Mar-04 3:46
wb9-Mar-04 3:46 
GeneralRe: Out of virtual memory Pin
martin_j9-Mar-04 3:48
martin_j9-Mar-04 3:48 
GeneralRe: Out of virtual memory Pin
David Crow9-Mar-04 3:57
David Crow9-Mar-04 3:57 
GeneralRe: Out of virtual memory Pin
martin_j9-Mar-04 4:06
martin_j9-Mar-04 4:06 
GeneralRe: Out of virtual memory Pin
Prakash Nadar9-Mar-04 4:40
Prakash Nadar9-Mar-04 4:40 
GeneralRelease <-> Debug woes Pin
Phil.Benson9-Mar-04 1:12
professionalPhil.Benson9-Mar-04 1:12 
Hi I have the following problem:

I have an executable that loads dlls (MFC extension dll´s).

All the dll´s are based on a parent class with various functions. To name a few

BOOL mfb_open_database (LPCTSTR);
CString mfx_get_module_name();
CString mfx_get_item_text (LPVOID);

The functions are called from the main application using a pointer to the dll class..

x_txt = px_dll->mfx_get_item_text((LPVOID)something);

The functions in the dll´s are all with AFX_MANAGE_STATE(..) because I´m loading things from the (DLL´s) resources

The funny thing is only the mfx_get_module_name() does not work, all the others do.

Tracing through this (I have added the debug symbols to the release mode of a dll and the exe)

It comes about when the constructors for the CString objects are called. As far as I can tell, the DLL creates a CString object to be returned. Instead of a "Deep" copy, only the reference of it´s m_pchData is copied to the CString Object in the exe, and when the destructor for the CString Object in the exe is called, the MFC crashes and says that the Object that is to be destroyed is not in the "correct" heap. I have tried adding
::LockBuffer() to the CString object that is created in the DLL as the returned object but to no avail.

I have checked all the project settings etc. and can´t find anything wrong.

This function worked perfectly well up until yesterday, until my devstudio crashed a few times. I´ve checked all the settings in Project setings but can´t find anything un toward. Has anybody any idea´s I´m at my wits end....

Thanks in advance

Phil



bum... and I thought I´d got rid of all the bugs Frown | :(
GeneralRe: Release <-> Debug woes Pin
wb9-Mar-04 3:33
wb9-Mar-04 3:33 
GeneralRe: Release <-> Debug woes Pin
Phil.Benson9-Mar-04 3:42
professionalPhil.Benson9-Mar-04 3:42 
GeneralRe: Release <-> Debug woes Pin
wb9-Mar-04 3:56
wb9-Mar-04 3:56 
GeneralRe: Release <-> Debug woes Pin
Phil.Benson9-Mar-04 4:13
professionalPhil.Benson9-Mar-04 4:13 
GeneralRe: Release <-> Debug woes Pin
Phil.Benson22-Apr-04 1:48
professionalPhil.Benson22-Apr-04 1:48 
QuestionAre DLL`s slow? Pin
GDavy9-Mar-04 0:56
GDavy9-Mar-04 0:56 
AnswerRe: Are DLL`s slow? Pin
Prakash Nadar9-Mar-04 1:03
Prakash Nadar9-Mar-04 1:03 
AnswerRe: Are DLL`s slow? Pin
Anonymous9-Mar-04 4:26
Anonymous9-Mar-04 4:26 
GeneralWindowed DirectDraw screen garbage Pin
paulkned9-Mar-04 0:39
paulkned9-Mar-04 0:39 
GeneralModeless Dialog Box Pin
mmica9-Mar-04 0:19
mmica9-Mar-04 0:19 
GeneralRe: Modeless Dialog Box Pin
Prakash Nadar9-Mar-04 1:08
Prakash Nadar9-Mar-04 1:08 
GeneralRe: Modeless Dialog Box Pin
mmica9-Mar-04 1:44
mmica9-Mar-04 1:44 
GeneralRe: Modeless Dialog Box Pin
Prakash Nadar9-Mar-04 2:28
Prakash Nadar9-Mar-04 2:28 
GeneralRe: Modeless Dialog Box Pin
David Crow9-Mar-04 2:42
David Crow9-Mar-04 2:42 
GeneralRe: Modeless Dialog Box Pin
Prakash Nadar9-Mar-04 2:49
Prakash Nadar9-Mar-04 2:49 
GeneralRe: Modeless Dialog Box Pin
David Crow9-Mar-04 2:43
David Crow9-Mar-04 2:43 
GeneralRe: Modeless Dialog Box Pin
bilal789-Mar-04 1:51
bilal789-Mar-04 1: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.