Click here to Skip to main content
15,899,314 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: _beginthread vs _beginthreadex -- FYI Pin
Mark Salsbery16-Oct-08 10:44
Mark Salsbery16-Oct-08 10:44 
QuestionA Very Simple MFC Application Pin
BobInNJ16-Oct-08 7:57
BobInNJ16-Oct-08 7:57 
AnswerRe: A Very Simple MFC Application Pin
led mike16-Oct-08 8:08
led mike16-Oct-08 8:08 
GeneralRe: A Very Simple MFC Application Pin
BobInNJ16-Oct-08 9:54
BobInNJ16-Oct-08 9:54 
AnswerRe: A Very Simple MFC Application Pin
Mark Salsbery16-Oct-08 8:30
Mark Salsbery16-Oct-08 8:30 
GeneralRe: A Very Simple MFC Application Pin
BobInNJ16-Oct-08 10:06
BobInNJ16-Oct-08 10:06 
GeneralRe: A Very Simple MFC Application Pin
Mark Salsbery16-Oct-08 10:19
Mark Salsbery16-Oct-08 10:19 
GeneralRe: A Very Simple MFC Application Pin
BobInNJ16-Oct-08 10:38
BobInNJ16-Oct-08 10:38 
Mark,

Thanks for the prompt response.I do nto remeber saying that it dies in DragAcceptFiles. If I did, I was wrong. Sorry about that. In any case, here is a partial listing of the routine it dies in.

<br />
CDocument* CSingleDocTemplate::OpenDocumentFile(LPCTSTR lpszPathName,<br />
	BOOL bMakeVisible)<br />
	// if lpszPathName == NULL => create new file of this type<br />
{<br />
	CDocument* pDocument = NULL;<br />
	CFrameWnd* pFrame = NULL;<br />
	BOOL bCreated = FALSE;      // => doc and frame created<br />
	BOOL bWasModified = FALSE;<br />
<br />
	if (m_pOnlyDoc != NULL)<br />
	{<br />
		// already have a document - reinit it<br />
		pDocument = m_pOnlyDoc;<br />
		if (!pDocument->SaveModified())<br />
			return NULL;        // leave the original one<br />
<br />
		pFrame = (CFrameWnd*)AfxGetMainWnd();<br />
		ASSERT(pFrame != NULL);<br />
		ASSERT_KINDOF(CFrameWnd, pFrame);<br />
		ASSERT_VALID(pFrame);<br />
	}<br />
	else<br />
	{<br />
		// create a new document<br />
		pDocument = CreateNewDocument();<br />
		ASSERT(pFrame == NULL);     // will be created below<br />
		bCreated = TRUE;<br />
	}<br />
<br />
	if (pDocument == NULL)<br />
	{<br />
		AfxMessageBox(AFX_IDP_FAILED_TO_CREATE_DOC);<br />
		return NULL;<br />
	}<br />
	ASSERT(pDocument == m_pOnlyDoc);<br />


The statement that is gennerating the message box is:
AfxMessageBox(AFX_IDP_FAILED_TO_CREATE_DOC);

I am thinking that CreateNewDocument should not be returning NULL but it is.

Thanks
Bob
GeneralRe: A Very Simple MFC Application Pin
Mark Salsbery16-Oct-08 10:42
Mark Salsbery16-Oct-08 10:42 
GeneralRe: A Very Simple MFC Application Pin
BobInNJ16-Oct-08 10:47
BobInNJ16-Oct-08 10:47 
GeneralRe: A Very Simple MFC Application Pin
Mark Salsbery16-Oct-08 10:53
Mark Salsbery16-Oct-08 10:53 
GeneralRe: A Very Simple MFC Application Pin
Mark Salsbery16-Oct-08 10:58
Mark Salsbery16-Oct-08 10:58 
GeneralRe: A Very Simple MFC Application Pin
led mike16-Oct-08 11:24
led mike16-Oct-08 11:24 
GeneralRe: A Very Simple MFC Application Pin
Mark Salsbery16-Oct-08 11:48
Mark Salsbery16-Oct-08 11:48 
GeneralRe: A Very Simple MFC Application Pin
BobInNJ16-Oct-08 11:26
BobInNJ16-Oct-08 11:26 
QuestionRe: A Very Simple MFC Application Pin
David Crow16-Oct-08 10:35
David Crow16-Oct-08 10:35 
AnswerRe: A Very Simple MFC Application Pin
BobInNJ16-Oct-08 10:42
BobInNJ16-Oct-08 10:42 
QuestionRe: A Very Simple MFC Application Pin
David Crow16-Oct-08 10:45
David Crow16-Oct-08 10:45 
AnswerRe: A Very Simple MFC Application Pin
BobInNJ16-Oct-08 10:48
BobInNJ16-Oct-08 10:48 
GeneralRe: A Very Simple MFC Application Pin
David Crow16-Oct-08 10:52
David Crow16-Oct-08 10:52 
GeneralRe: A Very Simple MFC Application Pin
BobInNJ16-Oct-08 11:20
BobInNJ16-Oct-08 11:20 
GeneralRe: A Very Simple MFC Application Pin
Mark Salsbery16-Oct-08 10:47
Mark Salsbery16-Oct-08 10:47 
AnswerRe: A Very Simple MFC Application Pin
BobInNJ16-Oct-08 12:41
BobInNJ16-Oct-08 12:41 
GeneralRe: A Very Simple MFC Application Pin
User 21559716-Oct-08 18:17
User 21559716-Oct-08 18:17 
GeneralRe: A Very Simple MFC Application Pin
BobInNJ17-Oct-08 2:32
BobInNJ17-Oct-08 2:32 

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.