Click here to Skip to main content
15,892,072 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionThreads Pin
Eytukan25-Aug-05 7:01
Eytukan25-Aug-05 7:01 
AnswerRe: Threads Pin
Jack Puppy25-Aug-05 7:20
Jack Puppy25-Aug-05 7:20 
AnswerRe: Threads Pin
David Crow25-Aug-05 7:46
David Crow25-Aug-05 7:46 
AnswerRe: Threads Pin
LighthouseJ25-Aug-05 17:03
LighthouseJ25-Aug-05 17:03 
QuestionThankz guys and about "ExitInstance()" ? Pin
Eytukan25-Aug-05 22:42
Eytukan25-Aug-05 22:42 
QuestionProgress Dialog Pin
swati2425-Aug-05 6:59
swati2425-Aug-05 6:59 
AnswerRe: Progress Dialog Pin
David Crow25-Aug-05 7:48
David Crow25-Aug-05 7:48 
GeneralRe: Progress Dialog -- Modified Pin
swati2425-Aug-05 8:28
swati2425-Aug-05 8:28 
There is an ASSERT failure ... This is how the Create for dialog works....
The assertion is caused when CWnd::CreateDlgIndirect(LPCDLGTEMPLATE lpDialogTemplate,
CWnd* pParentWnd, HINSTANCE hInst) is called and lpDialogTemplate is NULL.

<br />
CDialog::Create(LPCTSTR lpszTemplateName, CWnd* pParentWnd)<br />
{<br />
  .....<br />
  BOOL bResult = CreateIndirect(hTemplate, pParentWnd, hInst);<br />
<br />
}<br />
<br />
<br />
BOOL CDialog::CreateIndirect(HGLOBAL hDialogTemplate, CWnd* pParentWnd,<br />
	HINSTANCE hInst)<br />
{<br />
	ASSERT(hDialogTemplate != NULL); //THIS IS OK<br />
<br />
	LPCDLGTEMPLATE lpDialogTemplate = (LPCDLGTEMPLATE)LockResource(hDialogTemplate);<br />
	BOOL bResult = CreateIndirect(lpDialogTemplate, pParentWnd, NULL, hInst); //lpDialogTemplate is not NULL but pParentWnd is<br />
	UnlockResource(hDialogTemplate);<br />
<br />
	return bResult;<br />
}<br />
<br />
<br />
BOOL CDialog::CreateIndirect(LPCDLGTEMPLATE lpDialogTemplate, CWnd* pParentWnd,<br />
	void* lpDialogInit, HINSTANCE hInst)<br />
{<br />
	ASSERT(lpDialogTemplate != NULL);<br />
<br />
	if (pParentWnd == NULL)<br />
		pParentWnd = AfxGetMainWnd(); //I THINK SINCE I USE MDI APP AfxGetMainWnd() will return CMDIFrameWnd()...COULD THIS BE A PROBLEM??<br />
	m_lpDialogInit = lpDialogInit; //m_lpDialogInit is NULL<br />
<br />
	return CreateDlgIndirect(lpDialogTemplate, pParentWnd, hInst);<br />
}<br />
<br />
BOOL CWnd::CreateDlgIndirect(LPCDLGTEMPLATE lpDialogTemplate,<br />
	CWnd* pParentWnd, HINSTANCE hInst)<br />
{<br />
	ASSERT(lpDialogTemplate != NULL);<br />
	....<br />
        hWnd = ::CreateDialogIndirect(hInst, lpDialogTemplate,<br />
			pParentWnd->GetSafeHwnd(), AfxDlgProc); //CAUSES ASSERTION FAILURE<br />
<br />
<br />
<br />
}<br />
<br />

Swati

-- modifed at 14:43 Thursday 25th August, 2005
General[Message Deleted] Pin
David Crow25-Aug-05 8:40
David Crow25-Aug-05 8:40 
GeneralRe: [Msg Deleted] Pin
swati2425-Aug-05 8:51
swati2425-Aug-05 8:51 
GeneralRe: Progress Dialog Pin
swati2425-Aug-05 8:41
swati2425-Aug-05 8:41 
GeneralRe: Progress Dialog Pin
swati2425-Aug-05 9:33
swati2425-Aug-05 9:33 
QuestionDisplay/Font Size GUI issues. Pin
oleg6325-Aug-05 6:40
professionaloleg6325-Aug-05 6:40 
QuestionSimple question if anyone knows it Pin
Joel Holdsworth25-Aug-05 6:30
Joel Holdsworth25-Aug-05 6:30 
AnswerRe: Simple question if anyone knows it Pin
David Crow25-Aug-05 7:53
David Crow25-Aug-05 7:53 
QuestionRe: Simple question if anyone knows it Pin
Joel Holdsworth25-Aug-05 21:52
Joel Holdsworth25-Aug-05 21:52 
QuestionDownload accelarator Pin
Y_R25-Aug-05 6:26
Y_R25-Aug-05 6:26 
AnswerRe: Download accelarator Pin
Chris Losinger25-Aug-05 10:07
professionalChris Losinger25-Aug-05 10:07 
GeneralRe: Download accelarator Pin
Y_R26-Aug-05 0:09
Y_R26-Aug-05 0:09 
QuestionSkype GUI? Pin
wakkerjack25-Aug-05 6:16
wakkerjack25-Aug-05 6:16 
QuestionPrinting line with DASHDOT style (MFC) Pin
AnTri25-Aug-05 5:51
AnTri25-Aug-05 5:51 
QuestionDriver interface Pin
Paresh emb25-Aug-05 5:51
Paresh emb25-Aug-05 5:51 
QuestionMJPEG Enc/Decoding Pin
Galootka25-Aug-05 5:35
Galootka25-Aug-05 5:35 
QuestionRe: MJPEG Enc/Decoding Pin
David Crow25-Aug-05 8:28
David Crow25-Aug-05 8:28 
AnswerRe: MJPEG Enc/Decoding Pin
Galootka27-Aug-05 2:46
Galootka27-Aug-05 2:46 

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.