This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Re: DotNetCoCreateObject not able to create object
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Feb 01, 2012
03:28 AM
DotNetCoCreateObject not able to create object
Hi,
I am new to installshield 2011 and trying to use DotNetCoCreateObject in my installscript for installscript msi project.
It is not able to create object for my .Net4.0 dll and failes with error code -2147219705.
My code snippet is as below:
try szPath=TARGETDIR+"trial\\Encryption.dll";
LongPathToShortPath(szPath);
set oEncrypt=DotNetCoCreateObject(szPath,"Encryption.Encrypter","");
if(IsEmpty(oEncrypt)) then
MessageBox("Error",SEVERE);
endif; returnValue=oEncrypt.Encrypt(svSetupExeDir,"HAF7DAHASDS");
catch
MessageBox(Err.Description,SEVERE);
abort;
endcatch;
On debugging found that messagebox is displayed from try & catch block and not from if block.
Please let me know what am i doing wrong.
Any help is appreciated.
Thanks in Advance,
SagaR
I am new to installshield 2011 and trying to use DotNetCoCreateObject in my installscript for installscript msi project.
It is not able to create object for my .Net4.0 dll and failes with error code -2147219705.
My code snippet is as below:
try szPath=TARGETDIR+"trial\\Encryption.dll";
LongPathToShortPath(szPath);
set oEncrypt=DotNetCoCreateObject(szPath,"Encryption.Encrypter","");
if(IsEmpty(oEncrypt)) then
MessageBox("Error",SEVERE);
endif; returnValue=oEncrypt.Encrypt(svSetupExeDir,"HAF7DAHASDS");
catch
MessageBox(Err.Description,SEVERE);
abort;
endcatch;
On debugging found that messagebox is displayed from try & catch block and not from if block.
Please let me know what am i doing wrong.
Any help is appreciated.
Thanks in Advance,
SagaR
(2) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Feb 15, 2012
06:50 AM
You can set assembly: ComVisible(false) to assembly: ComVisible(true). The exception will not come.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Feb 15, 2012
07:50 AM
DotNetCoCreateObject was great when it came out but I no longer reccomend using it. I suggest looking at WiX DTF custom actions. I've blogged about it extensively and it's basically a way of getting the best of the C++ world and the best of the C#/.NET world and it's fully compatible with InstallShield.
![](/skins/images/D60DF682EA37BF37032955CE10F3F0BB/responsive_peak/images/icon_anonymous_message.png)