Home > Software engineering >  C builder application invokes MFC DLL, using MFC DLL program crashes when the pop-up window
C builder application invokes MFC DLL, using MFC DLL program crashes when the pop-up window

Time:10-02

As title, I insert a form in the MFC DLL, and this form pops up in the export function, using the modal dialog box, I want to achieve through the form of DLL and the interaction between the main application, feeling cross-language is there is a problem, but I want to consult an experienced a great god, how can I achieve my needs?

CodePudding user response:

Call DLL collapse, you can see with breaking process commissioning under the specific cause of melt passing parameters can be done by pipeline

CodePudding user response:

MFC DLL had better use MFC to load the program, you are the best communication with c + + builder process communication program

CodePudding user response:

You are not C/C + +? What languages across?
Different compilers, maybe it's a different API package library,

CodePudding user response:

You won't because the collapse of the pop-up dialog reason:
By default, the MFC USES the resource handle of the main application to load the resource template. If you have an exported function in a DLL, to as one that launches a dialog box in the DLL, this template is later stored in the DLL module. You need to switch the module state for the correct handle to be 2. You can do this By adding the following code to the beginning of the function:

 AFX_MANAGE_STATE (AfxGetStaticModuleState ()); 


  • Related