Click here to Skip to main content
15,606,617 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: hi, all, the EDIT have already add ES_PASSWORD, but I want to Input DoubleChar, how to do it? Pin
Rajesh R Subramanian15-Oct-08 23:34
professionalRajesh R Subramanian15-Oct-08 23:34 
QuestionCMimeMessage error please help Pin
monsieur_jj15-Oct-08 16:57
monsieur_jj15-Oct-08 16:57 
QuestionRe: CMimeMessage error please help Pin
CPallini15-Oct-08 22:04
mveCPallini15-Oct-08 22:04 
AnswerRe: CMimeMessage error please help Pin
monsieur_jj15-Oct-08 22:08
monsieur_jj15-Oct-08 22:08 
QuestionMFC example Pin
BobInNJ15-Oct-08 14:44
BobInNJ15-Oct-08 14:44 
QuestionRe: MFC example Pin
David Crow15-Oct-08 17:32
David Crow15-Oct-08 17:32 
AnswerRe: MFC example Pin
CPallini15-Oct-08 21:56
mveCPallini15-Oct-08 21:56 
GeneralRe: MFC example Pin
BobInNJ16-Oct-08 4:44
BobInNJ16-Oct-08 4:44 
Thanks for the responses. Here are the details on the error: It dies with an assertion
error in the following MFC module:

void CSingleDocTemplate::SetDefaultTitle(CDocument* pDocument)
{
CString strDocName;
if (!GetDocString(strDocName, CDocTemplate::docName) ||
strDocName.IsEmpty())
{
// use generic 'untitled'
ENSURE(strDocName.LoadString(AFX_IDS_UNTITLED));
}
pDocument->SetTitle(strDocName);
}


Here is my InitInstance method.


BOOL CPaintApp::InitInstance ()
{
SetRegistryKey (TEXT("Programming Windows 95 with MFC"));
LoadStdProfileSettings ();

CSingleDocTemplate* pDocTemplate;
pDocTemplate = new CSingleDocTemplate (
IDR_MAINFRAME,
RUNTIME_CLASS (CPaintDoc),
RUNTIME_CLASS (CMainFrame),
RUNTIME_CLASS (CPaintView)
);

AddDocTemplate (pDocTemplate);
RegisterShellFileTypes (TRUE);

CCommandLineInfo cmdInfo;
ParseCommandLine (cmdInfo);

if (!ProcessShellCommand (cmdInfo))
return FALSE;

m_pMainWnd->DragAcceptFiles ();
return TRUE;
}

The code reaches the call to ProcessShellCommand. However, it dies in that call. Here is the call stack when it dies.

> chap8.1.exe!CSingleDocTemplate::SetDefaultTitle(CDocument * pDocument=0x003d9610) Line 210 + 0x2b bytes C++
chap8.1.exe!CSingleDocTemplate::OpenDocumentFile(const wchar_t * lpszPathName=0x00000000, int bMakeVisible=1) Line 141 C++
chap8.1.exe!CDocManager::OnFileNew() Line 848 C++
chap8.1.exe!CWinApp::OnFileNew() Line 22 C++
chap8.1.exe!_AfxDispatchCmdMsg(CCmdTarget * pTarget=0x0065eaf8, unsigned int nID=57600, int nCode=0, void (void)* pfn=0x004afaee, void * pExtra=0x00000000, unsigned int nSig=57, AFX_CMDHANDLERINFO * pHandlerInfo=0x00000000) Line 82 C++
chap8.1.exe!CCmdTarget::OnCmdMsg(unsigned int nID=57600, int nCode=0, void * pExtra=0x00000000, AFX_CMDHANDLERINFO * pHandlerInfo=0x00000000) Line 381 + 0x27 bytes C++
chap8.1.exe!CWinApp::ProcessShellCommand(CCommandLineInfo & rCmdInfo={...}) Line 24 + 0x20 bytes C++
chap8.1.exe!CPaintApp::InitInstance() Line 43 + 0xc bytes C++
chap8.1.exe!AfxWinMain(HINSTANCE__ * hInstance=0x00400000, HINSTANCE__ * hPrevInstance=0x00000000, wchar_t * lpCmdLine=0x00020928, int nCmdShow=1) Line 37 + 0xd bytes C++
chap8.1.exe!wWinMain(HINSTANCE__ * hInstance=0x00400000, HINSTANCE__ * hPrevInstance=0x00000000, wchar_t * lpCmdLine=0x00020928, int nCmdShow=1) Line 30 C++
chap8.1.exe!__tmainCRTStartup() Line 263 + 0x2c bytes C
chap8.1.exe!wWinMainCRTStartup() Line 182 C
kernel32.dll!7c817067()
[Frames below may be incorrect and/or missing, no symbols loaded for kernel32.dll]

The path of execution, includes the following method:
CPaintDoc::CPaintDoc ()
{
m_lineArray.SetSize (0, 64);
}

While the code is dying inside an MFC module, I have to assume that it is not a bug with MFC. Since, I am doing this as a learning exercise, what is the best way for me to debug this?

Thanks
Bob
QuestionEnvironment Variables Pin
jpyp15-Oct-08 11:47
jpyp15-Oct-08 11:47 
AnswerRe: Environment Variables Pin
Mark Salsbery15-Oct-08 13:30
Mark Salsbery15-Oct-08 13:30 
GeneralRe: Environment Variables Pin
jpyp16-Oct-08 8:26
jpyp16-Oct-08 8:26 
GeneralRe: Environment Variables [modified] Pin
Mark Salsbery16-Oct-08 9:11
Mark Salsbery16-Oct-08 9:11 
GeneralRe: Environment Variables Pin
jpyp16-Oct-08 10:15
jpyp16-Oct-08 10:15 
GeneralRe: Environment Variables [modified] Pin
Mark Salsbery16-Oct-08 10:27
Mark Salsbery16-Oct-08 10:27 
GeneralRe: Environment Variables Pin
jpyp16-Oct-08 10:52
jpyp16-Oct-08 10:52 
GeneralRe: Environment Variables Pin
Mark Salsbery16-Oct-08 11:03
Mark Salsbery16-Oct-08 11:03 
QuestionWeird error... Pin
Megidolaon15-Oct-08 11:08
Megidolaon15-Oct-08 11:08 
AnswerRe: Weird error... Pin
led mike15-Oct-08 11:32
led mike15-Oct-08 11:32 
GeneralRe: Weird error... Pin
Megidolaon15-Oct-08 11:37
Megidolaon15-Oct-08 11:37 
GeneralRe: Weird error... Pin
CPallini15-Oct-08 21:51
mveCPallini15-Oct-08 21:51 
QuestionRe: Weird error... Pin
David Crow15-Oct-08 17:29
David Crow15-Oct-08 17:29 
Questionautomatically click a button in another application Pin
Russell'15-Oct-08 9:34
Russell'15-Oct-08 9:34 
QuestionRe: automatically click a button in another application Pin
David Crow15-Oct-08 10:57
David Crow15-Oct-08 10:57 
AnswerRe: automatically click a button in another application Pin
Russell'15-Oct-08 11:28
Russell'15-Oct-08 11:28 
GeneralRe: automatically click a button in another application Pin
Russell'15-Oct-08 11:57
Russell'15-Oct-08 11:57 

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.