I created a MFC Extension DLL in VC++6.0, and include a dialog in the DLL.
In the export function, a dialog is created.
I need to display the dialog in a CVI exe application. I include the .h and
.lib files in the CVI project. In the main function of CVI exe, I call the
VC exported function to generate the dialog, but failed. The reason I've
got as far is when executing CDialog::Create(...) , WIN32 API AfxGetInstanceHandle()
is called. It should return the handle of current application., then the
location can be decided from where the resource loaded. But AfxGetInstanceHandle()
can¡¯t return a valid handle always NULL.
If the main application is generated with VC++6.0, no matter the display
function
is called directly by the VC++ application or via a DLL from CVI,
everything is OK. But if the main application is generated with CVI, it fails
all the time.
I don¡¯t know if the CVI exe application does not accept a VC++ DLL which
exports dialog. If it accepts such DLL, what should I do ?