Click here to Skip to main content
15,883,901 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I am trying to create a new frame window with toolbars inside a dll. I was able to create the frame and the toolbars but however the messages do not work properly in the CToolbar. Particularly the ON_UPDATE_COMMAND_UI messages are never called in the DLL. After some research I came to know that this is because PreTranslateMessage(MSG* pMsg) and OnIdle(LONG lCount)

need to be called. But my calling application is Delphi based and this cannot be done.

After research I came to know that this is best possible from an Extension dll. Since MFC extension dlls can only be called from an MFC application. I thought of the following solution.

Delphi calls an regular MFC dll The MFC dll calls the Extension dll.

But I have run into problems because of asserts in in MFC AfxGetResourceHandle() and AfxGetInstanceHandle().

But I am also aware that AFX_MANAGE_STATE(AfxGetStaticModuleState()); cannot be called from an extension dll.

Does anybody have a solution for this problem?
Posted
Comments
KarstenK 2-Jun-15 15:38pm    
The regular MFc-dll isnt an app with a message queue and valid windows handles so the assert are yelling. Take it serious: it wont work because of the good reasons.

I got no clue: Consider another solution - at best Delphi based.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900