note: This post is not for the timid.
When using the Automation Win32 DLL interface (part of the Admin studio functionality only!) i have always been having with problems with running the build from "C". With InstallAWARE 5 I had finally found a solution that did not cause any crashing of miaauto.dll when my program terminates. I had to use a dynamic dll call (with VC6) like this:
Code: Select all
void BuildNow(HINSTANCE hinstCurrent) {
HINSTANCE dllHandle = NULL;
BUILDTYPE BuildFunctionPtr = NULL;
BOOL freeResult = FALSE;
BOOL runTimeLinkSuccess = FALSE;
BOOL retVal;
//Load the dll and keep the handle to it
dllHandle = LoadLibrary("miaauto.dll");
// If the handle is valid, try to get the function address.
if (NULL != dllHandle) {
//Get pointer to our function using GetProcAddress:
BuildFunctionPtr = (BUILDTYPE)GetProcAddress(dllHandle, "miaBuildProjectEx");
// If the function address is valid, call the function.
if (runTimeLinkSuccess = (NULL != BuildFunctionPtr)) {
GetParams();
retVal = BuildFunctionPtr(g_var->lpProject,
g_var->lpOutput,
g_var->lpLog,
g_var->lpConditionals,
g_var->lpLanguage,
g_var->lpPassword,
g_var->nMode);
if (retVal == FALSE){
MessageBox(0, "Build Failed!\\nPlease review the log and correct any errors.", "Build Failed",
MB_OK | MB_ICONEXCLAMATION | MB_APPLMODAL);
}
}
//note: this will cause a crash of the miaauto.dll (ver5) on unload of this program -- so don't call FreeLibrary
//freeResult = FreeLibrary(dllHandle);
}
if(!runTimeLinkSuccess)
MessageBox(0, "Unable to load miaauto.dll", "File Load Error", MB_OK | MB_ICONEXCLAMATION | MB_APPLMODAL);
}
Now with InstallAWARE version 7 I find this no longer works. I'm torn with keeping the new version because it is not likely that I will be able to comunicate the details of this problem to InstallAWARE as it is too complex. I barely understand it myself. My heart is praying that you will have mercy and spend some time to resolve this problem ...
Anyway, the new error InstallAWARE 7 message from miaauto.dll when unloading is:
Exception Exception in module miaauto.dll at 001A54AB.
Need call dxFinalizeGDIPlus before free library!.
So the other question that i wonder about is that the "Finalize" concepts are usually with dot Net programming. I am using plain old Win32DLL from VC6. This shouldn't be an issue. The other thing is that I have only tested on the Vista O/S so far. I have no reason to think that there won't be a problem on XP/2K as there always was before.