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: .Net function call problem
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
‎Dec 18, 2007
03:21 PM
.Net function call problem
Hi!
I'm calling an .net object created by DotNetCoCreateObject. The object is successfully created, but when I call one of its public methods, I get an "The parameter is incorrect." error.
Here is my code:
set oObj = DotNetCoCreateObject (SUPPORTDIR ^ "SetupDBHelper.dll", "SetupDBHelper.SqlServerHelper","");
nResult = oObj.Ping(sLogRepositoryConnString);
Any idea of what could be the problem?
I'm calling an .net object created by DotNetCoCreateObject. The object is successfully created, but when I call one of its public methods, I get an "The parameter is incorrect." error.
Here is my code:
set oObj = DotNetCoCreateObject (SUPPORTDIR ^ "SetupDBHelper.dll", "SetupDBHelper.SqlServerHelper","");
nResult = oObj.Ping(sLogRepositoryConnString);
Any idea of what could be the problem?
(2) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Dec 19, 2007
02:01 AM
Hi,
I'm a beginner with installshield, but for your problem have you declare the prototype of the function dot net you want to use => who is : SetupDBHelper.SqlServerHelper ?
If not, here is it a sample :
Have a nice day
Christophe
I'm a beginner with installshield, but for your problem have you declare the prototype of the function dot net you want to use => who is : SetupDBHelper.SqlServerHelper ?
If not, here is it a sample :
prototype TypeOfReturn SetupDBHelper.SqlServerHelper(YourParameter1, yourParameter2, ...);
Have a nice day
Christophe
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Dec 20, 2007
09:08 PM
You probably want to replace SUPPORTDIR with a call to MsiGetProperty to get the SUPPORTDIR directory property.
Otherwise you seem to have the right concept. In your .NET code, declarate your class as ComVisible(true) and instantiate it by using the NameSpace.Class like you show. You might also want to use some try catch blocks cause if you try to invoke a member on an object that isn't valid, kaboom.
Btw my blog has lots of examples in this area.
Otherwise you seem to have the right concept. In your .NET code, declarate your class as ComVisible(true) and instantiate it by using the NameSpace.Class like you show. You might also want to use some try catch blocks cause if you try to invoke a member on an object that isn't valid, kaboom.
Btw my blog has lots of examples in this area.