Click here to Skip to main content
15,889,909 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: rand() is not random Pin
Arman S.12-Feb-09 20:45
Arman S.12-Feb-09 20:45 
AnswerRe: rand() is not random Pin
Stuart Dootson12-Feb-09 22:02
professionalStuart Dootson12-Feb-09 22:02 
AnswerRe: rand() is not random Pin
David Crow13-Feb-09 3:30
David Crow13-Feb-09 3:30 
AnswerRe: rand() is not random Pin
Rajesh R Subramanian13-Feb-09 5:15
professionalRajesh R Subramanian13-Feb-09 5:15 
QuestionTrying to create a pair of check boxes Pin
BobInNJ12-Feb-09 11:33
BobInNJ12-Feb-09 11:33 
AnswerRe: Trying to create a pair of check boxes Pin
Code-o-mat12-Feb-09 11:40
Code-o-mat12-Feb-09 11:40 
AnswerRe: Trying to create a pair of check boxes Pin
Stuart Dootson12-Feb-09 11:43
professionalStuart Dootson12-Feb-09 11:43 
QuestionChanging menus in MDI ( MFC) Pin
Like2Byte12-Feb-09 10:02
Like2Byte12-Feb-09 10:02 
I've got a frame that's contained in a DLL and called via:
extern "C" __declspec(dllexport) BOOL APIENTRY TermLoaderMode()
{
static CBaseMultiDocTemplate *pDocTemplate = NULL; //Derived from CMultiDocTemplate

CBaseApp *pApp = (CBaseApp *)AfxGetApp();

if (pDocTemplate == NULL)
{
pDocTemplate = new CBaseMultiDocTemplate( IDR_LOADER_USER,
RUNTIME_CLASS(CBaseDoc),
RUNTIME_CLASS(CTermLoaderFrame),
RUNTIME_CLASS(CTermLoaderView));
pApp->AddDocTemplate( pDocTemplate );
}
return( TRUE );
}

I'm trying to change out IDR_LOADER_USER with IDR_LOADER_DEV based upon user type. Users get IDR_LOADER_USER, devs get IDR_LOADER_DEV.

In my view class' OnInitialUpdate(), I call the following function but it fails on ::LoadMenu. (returns NULL).

Here's my menu grab function:

void CTermLoaderView::ReplaceMenu(void)
{
HMENU hm = ((CTermLoaderView*)GetDocument())->m_hMenuDefault = ::LoadMenu( ::AfxGetResourceHandle(), MAKEINTRESOURCE(IDR_LOADER_DEV));

if(((CTermLoaderView*)GetDocument())->m_hMenuDefault == NULL)
{
TRACE0("Failure to get menu object.");
AfxMessageBox(_T("Failure to get menu object."));
return;
}

CMDIFrameWnd* frame = ((CTermLoaderView*)GetParent())->GetMDIFrame();
frame->MDISetMenu(CMenu::FromHandle(((CTermLoaderView*)GetDocument())->m_hMenuDefault), NULL);
frame->DrawMenuBar();
}

Help?

Thanks in advance!Confused | :confused:
QuestionNeed help on MCI functions Pin
John50212-Feb-09 9:32
John50212-Feb-09 9:32 
QuestionImpersonation via network Pin
Green Fuze12-Feb-09 9:09
Green Fuze12-Feb-09 9:09 
QuestionReadFile/WriteFile returning ERROR_INVALID_FUNCTION on USB device on Vista Pin
Keith Worden12-Feb-09 5:12
Keith Worden12-Feb-09 5:12 
AnswerRe: ReadFile/WriteFile returning ERROR_INVALID_FUNCTION on USB device on Vista Pin
Stuart Dootson12-Feb-09 6:59
professionalStuart Dootson12-Feb-09 6:59 
GeneralRe: ReadFile/WriteFile returning ERROR_INVALID_FUNCTION on USB device on Vista Pin
Keith Worden13-Feb-09 0:06
Keith Worden13-Feb-09 0:06 
GeneralRe: ReadFile/WriteFile returning ERROR_INVALID_FUNCTION on USB device on Vista Pin
Stuart Dootson13-Feb-09 0:17
professionalStuart Dootson13-Feb-09 0:17 
QuestionTCHAR as Key in a map. Pin
Comp_Users12-Feb-09 1:28
Comp_Users12-Feb-09 1:28 
GeneralRe: TCHAR as Key in a map. Pin
liangyenchyen12-Feb-09 1:40
liangyenchyen12-Feb-09 1:40 
GeneralRe: TCHAR as Key in a map. Pin
Comp_Users12-Feb-09 2:05
Comp_Users12-Feb-09 2:05 
AnswerRe: TCHAR as Key in a map. Pin
Stuart Dootson12-Feb-09 2:23
professionalStuart Dootson12-Feb-09 2:23 
GeneralRe: TCHAR as Key in a map. Pin
Comp_Users12-Feb-09 3:26
Comp_Users12-Feb-09 3:26 
AnswerRe: TCHAR as Key in a map. Pin
Cedric Moonen12-Feb-09 2:27
Cedric Moonen12-Feb-09 2:27 
AnswerRe: TCHAR as Key in a map. Pin
Eytukan12-Feb-09 2:58
Eytukan12-Feb-09 2:58 
QuestionEclipse C++ Project references Pin
gvanto12-Feb-09 1:07
gvanto12-Feb-09 1:07 
AnswerRe: Eclipse C++ Project references Pin
Stuart Dootson12-Feb-09 2:11
professionalStuart Dootson12-Feb-09 2:11 
AnswerRe: Eclipse C++ Project references Pin
CPallini12-Feb-09 2:17
mveCPallini12-Feb-09 2:17 
GeneralRe: Eclipse C++ Project references [modified] Pin
gvanto12-Feb-09 12:16
gvanto12-Feb-09 12:16 

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.