Problem with external dll
Hey,
recently, I've been trying to use Moo (http://www.influenced.net/moodll.php) from within a VB.Net prog, but I'm having problems with the function declaration.
The functions (C++) look like
Code:
int __stdcall uptime(HWND mWnd, HWND aWnd, char *data, char *parms, BOOL print, BOOL nopause)
(standard declaration for mIRC's $dll calls - the function doesn't use anything but the data string/char-array, which it does a strcpy() to)
I have my function declaration like
Code:
Public Declare Auto Function uptime Lib "c:\moowrap\moo.dll" (ByRef mWnd, ByRef aWnd, ByRef data, ByVal parms, ByVal print, ByVal nopause) As Integer
my test-code looks like:
Code:
Dim mWnd As System.IntPtr
Dim aWnd As System.IntPtr
Dim data As String
Dim parms As String
Dim print As Boolean
Dim nopause As Boolean
mWnd = Me.Handle
aWnd = Me.Handle
data = ""
parms = ""
print = True
nopause = True
uptime(mWnd, aWnd, data, parms, print, nopause)
MessageBox.Show(data)
but i get a error message:
Quote:
An unhandled exception of type 'System.Runtime.InteropServices.InvalidOleVariantTypeException' occurred in WindowsApplication1.exe
Additional information: Specified OLE variant is invalid.
any thoughts? :)