Win 32 DLL Unload problems - Need call dxFinalizeGDIPlus.

Got a problem you cannot solve? Try here.
stevew
Posts: 78
Joined: Tue Dec 06, 2005 2:01 am

Win 32 DLL Unload problems - Need call dxFinalizeGDIPlus.

Postby stevew » Sun Jul 08, 2007 4:44 pm

HI,
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.

MichaelNesmith
Posts: 3452
Joined: Thu Dec 22, 2005 7:17 pm
Contact:

Postby MichaelNesmith » Mon Jul 09, 2007 3:27 am

Thanks for this report! I've escalated to R&D - we should see a fix very soon.
Michael Nesmith
InstallAware
Home of The Next Generation MSI Installer
Get your free copy today - http://www.installaware.com/

MichaelNesmith
Posts: 3452
Joined: Thu Dec 22, 2005 7:17 pm
Contact:

Postby MichaelNesmith » Mon Jul 09, 2007 6:21 am

Here you go, this is a fixed automation DLL.

File Attached:

miaauto.zip
Michael Nesmith

InstallAware

Home of The Next Generation MSI Installer

Get your free copy today - http://www.installaware.com/

stevew
Posts: 78
Joined: Tue Dec 06, 2005 2:01 am

Postby stevew » Mon Jul 09, 2007 9:32 am

Thanks Michael! Outstanding! And I have tested this out and it works great.

MichaelNesmith
Posts: 3452
Joined: Thu Dec 22, 2005 7:17 pm
Contact:

Postby MichaelNesmith » Mon Jul 09, 2007 5:27 pm

Thanks to R&D for the rapid response :)
Michael Nesmith

InstallAware

Home of The Next Generation MSI Installer

Get your free copy today - http://www.installaware.com/

stevew
Posts: 78
Joined: Tue Dec 06, 2005 2:01 am

Postby stevew » Thu Jul 12, 2007 10:41 pm

Hi Michael, I just checked the newer 7.0.1 and the problem is not fixed. I think the fix has not been included in update even though the file date is newer. I'm afraid the fix might have been dropped accidentially?

Gizm0
Posts: 339
Joined: Wed Nov 09, 2005 8:47 pm

Postby Gizm0 » Fri Jul 13, 2007 4:35 am

Did you download and install the Trial and then generate your license, or you just generated your license?
Panagiotis Kefalidis
Software Design Team Lead
\"In order to succeed, your desire for success should be greater than your fear of failure\"
InstallAware Software Corporation

stevew
Posts: 78
Joined: Tue Dec 06, 2005 2:01 am

Postby stevew » Fri Jul 13, 2007 9:35 am

hi, i generated a new license and downloaded the trial software again. i'm not sure why the license would be an issue. when i generate a license is this process based on what is installed on my PC?


Return to “Technical Support”

Who is online

Users browsing this forum: No registered users and 82 guests