|
Nemanja Trifunovic wrote: Ah, the beauties of MFC
(I would like to know Rajesh's thoughts about...)
Nemanja Trifunovic wrote: Apparently[^], using a local object is the canonical way to set a menu, but CMenu::Detach()[^] nneds to be called before the temp object goes out of scope.
Of course, the canonical way depends on the documentation author of the moment... [^].
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
OK, I just read this post.
Well, I see that MFC is *actually* beautiful. One mistake is that most frequently done by newbies is putting a CFont object on the stack, setting the font of a control with this, and then wondering why it "didn't work". But they'll eventually get things to work and will appreciate the framework.
“Follow your bliss.” – Joseph Campbell
|
|
|
|
|
transoft wrote: CMenu mu;
mu.LoadMenu(nMenuID);
SetMenu(&mu);
DrawMenuBar();
Is mu local or does it have class scope?
What line of what file is asserting?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
The Debugger did not guide me to there.
Thanks
|
|
|
|
|
Assertions have nothing to do with the debugger. When an assertion fires, you'll see:
Assertion Failed: File %hs, Line %d
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
atlmfc\include\afxwin1.inl: Line 900
Thanks,
|
|
|
|
|
So did you look at line 900 of afxwin1.inl to see what condition is asserting?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
{ ASSERT(this == NULL || m_hMenu == NULL || ::IsMenu(m_hMenu));
I think the menu was destroyed.
|
|
|
|
|
transoft wrote: CMenu* pMenu = GetMenu();
Does not return a CMenu* . You should be calling CWnd::GetMenu() .
|
|
|
|
|
Richard MacCutchan wrote: Does not return a CMenu*.
It does if called in the context of a CWnd -derived class.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
DavidCrow wrote: It does if called in the context of a CWnd-derived class.
My (mis-)reading of the documentation implied that you had to call this on a CWnd object reference.
Mr brain thought he was on holiday ...
|
|
|
|
|
Richard MacCutchan wrote: Mr brain thought he was on holiday ...
Ask Rajesh for a new monkey.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
After the call to SetMenu() you need to call mu.Detach() so the destructor does not destroy the handle.
|
|
|
|
|
I am not quite familar with this search engine!
|
|
|
|
|
Although not a C++ question: go to your home page and click on messages.
|
|
|
|
|
Hello,
I am developing multilingual MFC application.
My application has very heavy GUI, and I want to create resource DLL for each language, which my application load at run time when needed.
So I want to make resource DLL for application per language which just contain "string table" nothing else, and remaining resource should use from application default resource.
Basic requirement:
1) Don't want to redundant Image, Dialog and Menus in each resource DLL.
Can anyone suggest way for same?
Parag Patel
Sr. Software Eng, Varaha Systems
|
|
|
|
|
ParagPatel wrote: Don't want to redundant Image, Dialog and Menus in each resource DLL.
You just need to create a resource set comprising strings only. If there are any other auto-generated items they can be deleted.
|
|
|
|
|
Thanks Richard,
But I want to in a way so I no need to do any compilation and code change to support new language. Thats way i was preferring separate resource DLL.
What is your view/solution?
Parag Patel
Sr. Software Eng, Varaha Systems
|
|
|
|
|
ParagPatel wrote: Thats way i was preferring separate resource DLL.
That's what I was suggesting; create a DLL composed of all the string table resources and a simple function to return the relevant string table according to the language selected by the caller.
|
|
|
|
|
Yes same I want to do,
MFC provide API to load resource "SetResourceInstance", but I am confuge here that how can i set tow resource instance. one for default resource instance (Dialog, Image etc) and second for string table?
Thanks
Parag Patel
Sr. Software Eng, Varaha Systems
|
|
|
|
|
ParagPatel wrote: MFC provide API to load resource "SetResourceInstance"
I cannot find the MFC reference, only the one pertaining to ATL, which I have no experience of. I think you may need to look at how you access the resources, and whether to use pure Win32 to access them through the DLL.
|
|
|
|
|
Hello Sir
Recently i downloaded this source code from this link ..
MAPIEx: Extended MAPI Wrapper[^]
i can tested this code outlook 2003 and 2007 ..when i install outlook 2002..its not working ..i dont know why its not running ??
kindly help me Sir!!
Thanks
Raju !!!
|
|
|
|
|
Try posting your question in the article's Q&A section so the author sees it.
|
|
|
|
|
Thanks for your replay ..
Already ..that kind of question is there ..but its not there in relevant answer ..so that i posted in this section ..
Raju !!!
|
|
|
|
|
Your original question gives no information as to what may be wrong; "not working" tells us nothing. You will have to do some debugging and narrow it down to the area of code that is failing, and then post the lines of code that fail, and any error messages that you see.
|
|
|
|