Click here to Skip to main content
15,903,653 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Reference to a variable that goes out of scope Pin
Erudite_Eric17-Apr-12 22:31
Erudite_Eric17-Apr-12 22:31 
GeneralRe: Reference to a variable that goes out of scope Pin
Stefan_Lang20-Apr-12 4:10
Stefan_Lang20-Apr-12 4:10 
GeneralRe: Reference to a variable that goes out of scope Pin
Erudite_Eric20-Apr-12 22:04
Erudite_Eric20-Apr-12 22:04 
Question[solved ]: 'MAKEINTRESOURCE' - Not Working Properly Pin
AmbiguousName17-Apr-12 0:31
AmbiguousName17-Apr-12 0:31 
QuestionRe: 'MAKEINTRESOURCE' - Not Working Properly Pin
David Crow17-Apr-12 3:10
David Crow17-Apr-12 3:10 
AnswerRe: 'MAKEINTRESOURCE' - Not Working Properly Pin
AmbiguousName17-Apr-12 5:31
AmbiguousName17-Apr-12 5:31 
AnswerRe: 'MAKEINTRESOURCE' - Not Working Properly Pin
Richard MacCutchan17-Apr-12 4:49
mveRichard MacCutchan17-Apr-12 4:49 
AnswerRe: 'MAKEINTRESOURCE' - Not Working Properly Pin
AmbiguousName17-Apr-12 5:31
AmbiguousName17-Apr-12 5:31 
Assertion Shown: Debug Assertion Failed

Context of the program: actually I am adding CPropertyPages to CPropertySheet. Now when I pass the property page's IDD to CPropertyPage's constructor, there this macro can not cast this integer value to LPCTSTR (the resource type). Here is what the constructor looks like
C++
CString1Dlg::CString1Dlg(CWnd* pParent /*=NULL*/): CPropertyPage(CString1Dlg::IDD)
{
}

Now the point where it shows this assertion, looks like this.
C++
CPropertyPage::CPropertyPage(UINT nIDTemplate, UINT nIDCaption, DWORD dwSize)
{
	ASSERT(nIDTemplate != 0);
	AllocPSP(dwSize);
	CommonConstruct(MAKEINTRESOURCE(nIDTemplate), nIDCaption);
}

I debugged the application and know that nIDTemplate contains the ResourceId. Now MAKEINTRESOURCE here, does not convert this ID to corresponding resource type. Thats why I asked this question. During debuggin I came to know that MAKEINTRESOURCE is not working but in the first place, the assertion is shown in afxwin1.inl - line 24, where code looks like this.
C++
_AFXWIN_INLINE HINSTANCE AFXAPI AfxGetResourceHandle()
{ 
   ASSERT(afxCurrentResourceHandle != NULL);
   return afxCurrentResourceHandle; 
}

I hope I was able to clear the picture.
This world is going to explode due to international politics, SOON.

GeneralRe: 'MAKEINTRESOURCE' - Not Working Properly Pin
David Crow17-Apr-12 5:37
David Crow17-Apr-12 5:37 
GeneralRe: 'MAKEINTRESOURCE' - Not Working Properly Pin
AmbiguousName17-Apr-12 5:51
AmbiguousName17-Apr-12 5:51 
GeneralRe: 'MAKEINTRESOURCE' - Not Working Properly Pin
David Crow17-Apr-12 6:01
David Crow17-Apr-12 6:01 
GeneralRe: 'MAKEINTRESOURCE' - Not Working Properly Pin
AmbiguousName17-Apr-12 6:07
AmbiguousName17-Apr-12 6:07 
QuestionRe: 'MAKEINTRESOURCE' - Not Working Properly Pin
David Crow17-Apr-12 6:39
David Crow17-Apr-12 6:39 
AnswerRe: 'MAKEINTRESOURCE' - Not Working Properly [modified] Pin
AmbiguousName17-Apr-12 6:57
AmbiguousName17-Apr-12 6:57 
GeneralRe: 'MAKEINTRESOURCE' - Not Working Properly [modified] Pin
David Crow18-Apr-12 5:08
David Crow18-Apr-12 5:08 
GeneralRe: 'MAKEINTRESOURCE' - Not Working Properly Pin
Richard MacCutchan17-Apr-12 7:08
mveRichard MacCutchan17-Apr-12 7:08 
Question[SOLVED] Accelerator key issue Pin
David Crow16-Apr-12 6:13
David Crow16-Apr-12 6:13 
AnswerRe: Accelerator key issue Pin
jkirkerx17-Apr-12 6:50
professionaljkirkerx17-Apr-12 6:50 
GeneralRe: Accelerator key issue Pin
David Crow17-Apr-12 7:44
David Crow17-Apr-12 7:44 
GeneralRe: Accelerator key issue Pin
jkirkerx17-Apr-12 8:30
professionaljkirkerx17-Apr-12 8:30 
GeneralRe: Accelerator key issue Pin
David Crow17-Apr-12 9:31
David Crow17-Apr-12 9:31 
GeneralRe: Accelerator key issue Pin
jkirkerx17-Apr-12 10:02
professionaljkirkerx17-Apr-12 10:02 
GeneralRe: Accelerator key issue Pin
David Crow17-Apr-12 17:47
David Crow17-Apr-12 17:47 
GeneralRe: Accelerator key issue Pin
jkirkerx17-Apr-12 18:23
professionaljkirkerx17-Apr-12 18:23 
GeneralRe: Accelerator key issue Pin
David Crow18-Apr-12 2:04
David Crow18-Apr-12 2:04 

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.