Hello,
I'm having problems calling a function in an unmanaged C dll using
VB.net. The program runs, then tries to execute the following function,
and just dies, no error message, even when I use a try/catch. I've used
the following two methods:
<DllImport("myDLL.DLL")> _
Public Shared Function GetSiteKeyAddV2(ByVal easyLicense As Integer,
ByVal addOn As Integer, ByVal userpassword As String, ByVal site_code
As String, ByVal level As Integer, ByVal options As Integer, ByVal
restriction_type As Object, ByVal num_days_or_runs As Object, ByVal
license_type As Object, ByVal copies As Integer, ByVal site_key as
string) As Integer
End Function
And
Private Declare Function GetSiteKeyAddV2 Lib "myDLL.DLL" ByVal
easyLicense As Integer, ByVal addOn As Integer, ByVal userpassword As
String, ByVal site_code As String, ByVal level As Integer, ByVal
options As Integer, ByVal restriction_type As Object, ByVal
num_days_or_runs As Object, ByVal license_type As Object, ByVal copies
As Integer, ByVal site_key as string) As Integer
Here's the C function definition:
int FUNCTYPE GetSiteKeyAddV2(int easyLicense, int addOn, char
*userpassword, char *site_code,
unsigned long level, unsigned long options,
unsigned restriction_type, unsigned num_days_or_runs,
unsigned license_type, int copies,
char *site_key);
Some things I'm concerned about are the unsigned c data types (which
I've mapped to vb.net object data types, though I don't know if this is
correct), and the fact that site_key returns a string.
Any help would be much appreciated, I'm very new to the interop stuff.
Thanks -
J