O
ofmars
Hi there,
In C# I'm using a DLL import attribute to call a function from this
DLL. This function was written in an older version of Vb and I know the
name of this function and it should return an integer.
public class Class1
{
[DllImport("DllDemo")]
public static extern int Initiliase(string Path);
}
// in Main Form
pathos = "initialisepath"
retval = Class1.Initialise(pathos);
Console.WriteLine(retval);
The DLL is found ... however this integer function I'm using, I'm
passing to it a string value which is this a case is a path to an INI
file. But its returning to me a -1 integer value and making Beep sound.
I'm passing a correct path. I tried to pass a garbaged string like
"dsfs3rt" to see if the problem was coming from the path but its
returning to me the same -1 integer value and making a beep sound.
I cannot see what this -1 means. Maybe I'm missing something. Maybe its
an error that doesn't stop the program.
Any help appreciated
Thanks
In C# I'm using a DLL import attribute to call a function from this
DLL. This function was written in an older version of Vb and I know the
name of this function and it should return an integer.
public class Class1
{
[DllImport("DllDemo")]
public static extern int Initiliase(string Path);
}
// in Main Form
pathos = "initialisepath"
retval = Class1.Initialise(pathos);
Console.WriteLine(retval);
The DLL is found ... however this integer function I'm using, I'm
passing to it a string value which is this a case is a path to an INI
file. But its returning to me a -1 integer value and making Beep sound.
I'm passing a correct path. I tried to pass a garbaged string like
"dsfs3rt" to see if the problem was coming from the path but its
returning to me the same -1 integer value and making a beep sound.
I cannot see what this -1 means. Maybe I'm missing something. Maybe its
an error that doesn't stop the program.
Any help appreciated
Thanks