Click here to Skip to main content
15,891,762 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralHTML Dialog question ... Pin
Hadi Rezaee28-Apr-04 23:29
Hadi Rezaee28-Apr-04 23:29 
GeneralDll & Vectors Pin
Bernhard28-Apr-04 23:10
Bernhard28-Apr-04 23:10 
GeneralRe: Dll & Vectors Pin
Anonymous29-Apr-04 0:05
Anonymous29-Apr-04 0:05 
GeneralRe: Dll & Vectors Pin
Mike Dimmick29-Apr-04 0:21
Mike Dimmick29-Apr-04 0:21 
GeneralRe: Dll & Vectors Pin
Antony M Kancidrowski29-Apr-04 3:20
Antony M Kancidrowski29-Apr-04 3:20 
GeneralProblem choosing collection… Pin
anderslundsgard28-Apr-04 22:53
anderslundsgard28-Apr-04 22:53 
GeneralRe: Problem choosing collection… Pin
David Crow29-Apr-04 2:13
David Crow29-Apr-04 2:13 
GeneralChildFrame and Menu Pin
amit_k_gupta28-Apr-04 22:52
amit_k_gupta28-Apr-04 22:52 
Hi,
I want to attach one of the menu resource to one of my child frame but i am not able to do so. I am putting code below, the following code is written in the App class and will execute on the click of a button:

CQSMChildFrame *pQSMMiniFrame = new CQSMChildFrame ;
if(!pQSMMiniFrame->LoadFrame(IDR_QSM,WS_OVERLAPPEDWINDOW | WS_CHILD, m_pMainWnd))
{
AfxMessageBox("Could not load QSM Frame");
return;
}

HMENU hMenu = NULL;
LPTSTR lpszMenuName = MAKEINTRESOURCE(IDR_QSM1);
if (lpszMenuName != NULL)
{
HINSTANCE hInst = AfxFindResourceHandle(lpszMenuName, RT_MENU);
if ((hMenu = ::LoadMenu(hInst, lpszMenuName)) == NULL)
{
AfxMessageBox("Warning: failed to load menu for CFrameWnd.\n");
return;
}
}

CMenu menu;
menu.Attach(hMenu);
BOOL y = pQSMMiniFrame->SetMenu(&menu);

pQSMMiniFrame->BringWindowToTop();
pQSMMiniFrame->SetOwner(m_pMainWnd);
pQSMMiniFrame->ShowWindow(SW_SHOW);
pQSMMiniFrame->UpdateWindow();


where CQSMChildFrame is derived from CMDIChildWnd and the application is an MDI based application.

When i debug the application, if fails at the SetMenu() line and returning false.

Even i tried loading and setting menu in the OnCreateClient() handler of CQSMChildFrame but not successful there also.

Please help me what i am doing wrong?

Thanks,
Amit
GeneralRound dialog drawing question Pin
YaronNir28-Apr-04 22:45
YaronNir28-Apr-04 22:45 
GeneralRe: Round dialog drawing question Pin
ohadp28-Apr-04 23:52
ohadp28-Apr-04 23:52 
GeneralRe: Round dialog drawing question Pin
YaronNir29-Apr-04 0:25
YaronNir29-Apr-04 0:25 
Questiongenerate c++ doc ? Pin
anderslundsgard28-Apr-04 22:25
anderslundsgard28-Apr-04 22:25 
AnswerRe: generate c++ doc ? Pin
Anonymous28-Apr-04 22:51
Anonymous28-Apr-04 22:51 
GeneralRe: generate c++ doc ? Pin
anderslundsgard28-Apr-04 22:55
anderslundsgard28-Apr-04 22:55 
AnswerRe: generate c++ doc ? Pin
Anonymous29-Apr-04 0:03
Anonymous29-Apr-04 0:03 
AnswerRe: generate c++ doc ? Pin
Pedro Ruiz29-Apr-04 0:31
Pedro Ruiz29-Apr-04 0:31 
GeneralClickety police ! Pin
Trollslayer29-Apr-04 1:03
mentorTrollslayer29-Apr-04 1:03 
GeneralWebBrowser Pin
Gem128-Apr-04 21:30
Gem128-Apr-04 21:30 
QuestionUsing CSplitterWindow with MFC? Pin
Roozbeh6928-Apr-04 21:26
professionalRoozbeh6928-Apr-04 21:26 
GeneralPdh API - CPU Counter returns 99 Pin
willy_23x28-Apr-04 20:53
willy_23x28-Apr-04 20:53 
GeneralRe: Pdh API - CPU Counter returns 99 Pin
David Crow29-Apr-04 2:19
David Crow29-Apr-04 2:19 
GeneralRe: Pdh API - CPU Counter returns 99 Pin
willy_23x29-Apr-04 2:28
willy_23x29-Apr-04 2:28 
Generalnumeric edit control and negative values Pin
Tyrus18228-Apr-04 20:37
Tyrus18228-Apr-04 20:37 
GeneralRe: numeric edit control and negative values Pin
harshadjahagirdar28-Apr-04 22:54
harshadjahagirdar28-Apr-04 22:54 
GeneralRe: numeric edit control and negative values Pin
David Crow29-Apr-04 2:21
David Crow29-Apr-04 2:21 

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.