tag:blogger.com,1999:blog-9537945.post-27574799674747296822007-08-07T15:07:00.000-05:002007-08-07T15:07:00.000-05:00No doubt. InstallShield's implementation of CoCre...No doubt. InstallShield's implementation of CoCreateObjectDotNet has been a lifesaver to me many times. A little tip for anyone using managed custom actions. As many people point out, managed code is "sticky". If you are using managed code custom actions in Windows Installer, make sure you free the module so that the next time you use it, it doesn't use the same one that is already in memory. I have found that when this happens, the module in memory has often held on to its properties.<BR/><BR/>Add this define to the top of your InstallScript:<BR/>prototype void ole32.CoFreeLibrary( byval int );<BR/><BR/>Then after you call the custom action, set the object to NOTHING and free the module using the following (hModule is an INT):<BR/>hModule = GetModuleHandle( MY_MC_CA );<BR/> if( !hModule ) then<BR/> //We can't get the handle to the module<BR/> else<BR/> CoFreeLibrary( hModule );<BR/> endif;AJhttp://www.blogger.com/profile/16538587727045104430noreply@blogger.com