Re: LoadMenu
In that case MFC is already initialized. You only need
to take care of maintating it by using the AFX_MANAGE_STATE
macro at the beginning of each entry point in your DLL,
e.g. in the beginning of each interface method implementation.
--
=====================================
Alexander Nickolov
Microsoft MVP [VC], MCSD
email: agnickolov@mvps.org
MVP VC FAQ: http://www.mvps.org/vcfaq
=====================================
"Thomas Freudenreich" <freudi_t@yahoo.de> wrote in message
news:p0xxaytks6vw$.14fc9dpr3fl17.dlg@40tude.net...
Am Thu, 16 Nov 2006 11:00:38 -0500 schrieb Igor Tandetnik:
Thomas Freudenreich <freudi_t@yahoo.de> wrote:
I programmed an ATL Control based on CComCompositeControl with VS2005.
Until now without WTL. I added a menuresource to the project for a
contextmenu and I add a Handler for every menuitem with the wizard.
But if I try
CMenu menu;
menu.LoadMenu( IDR_CONTEXT_MENU );
I get an ASSERT(afxCurrentResourceHandle != NULL);
in AfxFindResourceHandle.
You are using MFC's CMenu class, not WTL's one. And MFC is not properly
initialized in your application. If you don't want to use MFC, don't
include MFC headers (their names usually begin with afx,suchasafx.h
I want to use MFC and I checked that box during the process of initially
creating the project with the vs2005 wizard. What should I call to
initialize MFC ?