Click here to Skip to main content
15,925,309 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: How to get CPU ID Pin
David Crow24-Aug-07 5:49
David Crow24-Aug-07 5:49 
QuestionTooltip repositioning Pin
Nishad S23-Aug-07 22:30
Nishad S23-Aug-07 22:30 
QuestionHow to find memory leak in a big project? Pin
hafz23-Aug-07 22:23
hafz23-Aug-07 22:23 
AnswerRe: How to find memory leak in a big project? Pin
shyam bhiogade24-Aug-07 0:54
shyam bhiogade24-Aug-07 0:54 
AnswerRe: How to find memory leak in a big project? Pin
toxcct24-Aug-07 1:50
toxcct24-Aug-07 1:50 
AnswerRe: How to find memory leak in a big project? Pin
Hamid_RT24-Aug-07 2:47
Hamid_RT24-Aug-07 2:47 
Question64 bit programming issue... Pin
Kedar Potdar23-Aug-07 21:12
Kedar Potdar23-Aug-07 21:12 
Questiontormented by _CrtIsValidHeapPointer (t=day7) [modified] Pin
devvvy23-Aug-07 21:09
devvvy23-Aug-07 21:09 
memory allocation/dealloc - across multiple dll's

Anything I need to be aware of?
<br />
DllA::SomeFunc(){<br />
char * pszBuffer = new char[100];<br />
...<br />
strcpy(pszBuffer, pszData);<br />
DllB::SomeOtherFunc(pszBuffer);<br />
...<br />
delete [] pszBuffer; << delete from dll where you allocated it originally.<br />
pszBuffer = NULL;<br />
...<br />
}


I'm tormented by:

_ASSERTE(_CrtIsValidHeapPointer(pUserData));

The assert statement blew on application exit, after invoking StartupManager's destructor:
_CrtIsValidHeapPointer(const void * 0x00443270) line 1697<br />
_free_dbg_lk(void * 0x00443270, int 1) line 1044 + 9 bytes<br />
_free_dbg(void * 0x00443270, int 1) line 1001 + 13 bytes<br />
free(void * 0x00443270) line 956 + 11 bytes<br />
operator delete(void * 0x00443270) line 7 + 9 bytes<br />
std::allocator<char>::deallocate(void * 0x00443270, unsigned int 33) line 64 + 38 bytes<br />
std::basic_string<char,std::char_traits<char>,std::allocator<char> >::_Tidy(unsigned char 1) line 592<br />
std::basic_string<char,std::char_traits<char>,std::allocator<char> >::~basic_string<char,std::char_traits<char>,std::allocator<char> >() line 59 + 39 bytes<br />
CStartupManager::~CStartupManager() line 17 + 33 bytes<br />
InitApplication() line 18 + 18 bytes<br />
main(int 1, char * * 0x00441420) line 26


I tried WinDbg, but guess I'm not very good at it... and it told me no more information than Visual Studio.

I'd send you the stripped down version of the code (but error still reproducible) if you ask for it. THANKYOU!


Link:
1. http://msdn2.microsoft.com/en-us/library/ys6cfhhh(VS.80).aspx
AnswerRe: tormented by _CrtIsValidHeapPointer (t=day7) Pin
jhwurmbach23-Aug-07 21:56
jhwurmbach23-Aug-07 21:56 
GeneralRe: tormented by _CrtIsValidHeapPointer (t=day7) Pin
devvvy23-Aug-07 22:00
devvvy23-Aug-07 22:00 
GeneralRe: tormented by _CrtIsValidHeapPointer (t=day7) Pin
toxcct23-Aug-07 22:13
toxcct23-Aug-07 22:13 
Generalbecause this is stripped down test app with nothing more than init Pin
devvvy23-Aug-07 22:17
devvvy23-Aug-07 22:17 
GeneralRe: because this is stripped down test app with nothing more than init Pin
jhwurmbach23-Aug-07 23:52
jhwurmbach23-Aug-07 23:52 
AnswerRe: tormented by _CrtIsValidHeapPointer (t=day7) Pin
James R. Twine24-Aug-07 3:59
James R. Twine24-Aug-07 3:59 
GeneralRe: tormented by _CrtIsValidHeapPointer (t=day7) Pin
devvvy24-Aug-07 4:45
devvvy24-Aug-07 4:45 
AnswerRe: tormented by _CrtIsValidHeapPointer (t=day7) Pin
cmk24-Aug-07 10:00
cmk24-Aug-07 10:00 
GeneralRe: tormented by _CrtIsValidHeapPointer (t=day7) Pin
devvvy29-Aug-07 2:53
devvvy29-Aug-07 2:53 
Questionmultiple document-view architecture Pin
Taruni23-Aug-07 19:59
Taruni23-Aug-07 19:59 
AnswerRe: multiple document-view architecture Pin
jhwurmbach23-Aug-07 21:57
jhwurmbach23-Aug-07 21:57 
AnswerRe: multiple document-view architecture Pin
Iain Clarke, Warrior Programmer23-Aug-07 22:00
Iain Clarke, Warrior Programmer23-Aug-07 22:00 
GeneralRe: multiple document-view architecture Pin
jhwurmbach23-Aug-07 23:55
jhwurmbach23-Aug-07 23:55 
GeneralRe: multiple document-view architecture Pin
jhwurmbach24-Aug-07 0:37
jhwurmbach24-Aug-07 0:37 
General[Message Deleted] Pin
devvvy24-Aug-07 0:47
devvvy24-Aug-07 0:47 
GeneralRe: multiple document-view architecture Pin
jhwurmbach24-Aug-07 0:52
jhwurmbach24-Aug-07 0:52 
GeneralRe: multiple document-view architecture Pin
David Crow24-Aug-07 6:03
David Crow24-Aug-07 6:03 

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.