Display MFC dialogs in Word XP COM add-in

C

Cameron

Hello,

I am having great difficulty trying to make use of MFC derived dialog
boxes in a Word XP COM add-in I am developing. The problem boils down
to when the MFC code is trying to resolve the resource instance
handle. To see what i mean just create a dialog box using CDialog and
call its DoModal method. If you step through the code you will get a
number of asserts.

I have tried to put all the code into a MFC extension DLL (and a
regular DLL) and implement CDialog::DoModal with a call to set the
resource handle to the handle for the DLL prior to the base DoModal
call as one would to use a resource in a DLL. However I am still
running into the same problem.

Anyone have any idea whats going on here? I want to use MFC because
my add-in makes use of an internally developed MFC based UI library
and I do not want to have to re-write everything in Win32.

Cheers

Cameron
 
C

Chango V.

There shouldn't be a problem doing this. Usually, it takes just starting
each externally-callable function in a "regular" MFC DLL with:
AFX_MANAGE_STATE(AfxGetStaticModuleState());

//
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top