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
(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)Code:int __stdcall uptime(HWND mWnd, HWND aWnd, char *data, char *parms, BOOL print, BOOL nopause)
I have my function declaration like
my test-code looks 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
but i get a error message: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)
An unhandled exception of type 'System.Runtime.InteropServices.InvalidOleVariantTypeException' occurred in WindowsApplication1.exe
Additional information: Specified OLE variant is invalid.
any thoughts?![]()




Reply With Quote