Click here to Skip to main content
15,896,522 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: SendMessage??? Pin
Florin Ochiana13-Aug-03 3:39
Florin Ochiana13-Aug-03 3:39 
GeneralRe: SendMessage??? Pin
jhwurmbach13-Aug-03 3:55
jhwurmbach13-Aug-03 3:55 
AnswerRe: SendMessage??? Pin
Navin13-Aug-03 3:44
Navin13-Aug-03 3:44 
Generalinitialization of code in CWinApp Pin
pdunn13-Aug-03 1:32
pdunn13-Aug-03 1:32 
GeneralRe: initialization of code in CWinApp Pin
jhwurmbach13-Aug-03 2:34
jhwurmbach13-Aug-03 2:34 
GeneralRe: initialization of code in CWinApp Pin
pdunn13-Aug-03 2:58
pdunn13-Aug-03 2:58 
GeneralRe: initialization of code in CWinApp Pin
jhwurmbach13-Aug-03 3:29
jhwurmbach13-Aug-03 3:29 
GeneralRe: initialization of code in CWinApp Pin
pdunn14-Aug-03 4:22
pdunn14-Aug-03 4:22 
Thanks for the reply.

My code is not being skipped. It is the MFC, appcore.cpp. The (+) denotes where I placed a break point.

CWinApp::CWinApp(LPCTSTR lpszAppName)
{
(+) if (lpszAppName != NULL)
m_pszAppName = _tcsdup(lpszAppName);
else
m_pszAppName = NULL;

// initialize CWinThread state
AFX_MODULE_STATE* pModuleState =
_AFX_CMDTARGET_GETSTATE();
AFX_MODULE_THREAD_STATE* pThreadState =
pModuleState->m_thread;
ASSERT(AfxGetThread() == NULL);
pThreadState->m_pCurrentWinThread = this;
ASSERT(AfxGetThread() == this);
m_hThread = ::GetCurrentThread();
m_nThreadID = ::GetCurrentThreadId();

// initialize CWinApp state
ASSERT(afxCurrentWinApp == NULL);

// only one CWinApp object please
pModuleState->m_pCurrentWinApp = this;
ASSERT(AfxGetApp() == this);

// in non-running state until WinMain
(+) m_hInstance = NULL;
m_hLangResourceDLL = NULL;
m_pszHelpFilePath = NULL;
m_pszProfileName = NULL;
m_pszRegistryKey = NULL;
m_pszExeName = NULL;
m_pRecentFileList = NULL;
m_pDocManager = NULL;
m_atomApp = m_atomSystemTopic = NULL;
m_lpCmdLine = NULL;
m_pCmdInfo = NULL;
...}

The second breakpoint at 'm_hInstance = NULL;' never gets called because that is where the code skips causing 'm_pDocManager' not to get initialize. Thus when the program is closed, an error occurs because the program is trying to delete an uninitialized pointer.

The value inside of m_pDocManager is junk. Furthermore, the second breakpoint has a '?' (question mark) inside of it. I don't know what this means.

Thus the error does not come from the initInstance like I first thought but the constructor of CWinApp.



GeneralRe: initialization of code in CWinApp Pin
jhwurmbach14-Aug-03 4:38
jhwurmbach14-Aug-03 4:38 
GeneralNetwork Discovery & Remote execute Pin
maranv13-Aug-03 0:06
maranv13-Aug-03 0:06 
GeneralRe: Network Discovery & Remote execute Pin
Steve S13-Aug-03 0:10
Steve S13-Aug-03 0:10 
GeneralRe: Network Discovery & Remote execute Pin
maranv17-Aug-03 16:05
maranv17-Aug-03 16:05 
GeneralRe: Network Discovery & Remote execute Pin
David Crow13-Aug-03 5:40
David Crow13-Aug-03 5:40 
GeneralStandalone in place CEdit - Thanks to all Pin
Neville Franks12-Aug-03 23:43
Neville Franks12-Aug-03 23:43 
GeneralRe: Standalone in place CEdit - Thanks to all Pin
jhwurmbach13-Aug-03 2:31
jhwurmbach13-Aug-03 2:31 
GeneralRe: Standalone in place CEdit - Thanks to all Pin
Neville Franks13-Aug-03 6:35
Neville Franks13-Aug-03 6:35 
GeneralSorting Utility Pin
RChin12-Aug-03 23:32
RChin12-Aug-03 23:32 
GeneralNeed more details... Pin
Kochise13-Aug-03 0:23
Kochise13-Aug-03 0:23 
GeneralRe: Need more details... Pin
RChin13-Aug-03 0:31
RChin13-Aug-03 0:31 
GeneralRe: Need more details... Pin
Steve S13-Aug-03 0:43
Steve S13-Aug-03 0:43 
GeneralCreate() function. Pin
Neha12-Aug-03 22:16
Neha12-Aug-03 22:16 
GeneralRe: Create() function. Pin
jhwurmbach13-Aug-03 2:45
jhwurmbach13-Aug-03 2:45 
GeneralSave Image Pin
henli12-Aug-03 21:43
henli12-Aug-03 21:43 
GeneralRefresh problem Pin
Neha12-Aug-03 20:30
Neha12-Aug-03 20:30 
GeneralRe: Refresh problem Pin
Jörgen Sigvardsson12-Aug-03 22:56
Jörgen Sigvardsson12-Aug-03 22:56 

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.