|
-
Mar 10th, 2003, 10:49 AM
#1
Thread Starter
New Member
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:
An unhandled exception of type 'System.Runtime.InteropServices.InvalidOleVariantTypeException' occurred in WindowsApplication1.exe
Additional information: Specified OLE variant is invalid.
any thoughts?
-
Mar 10th, 2003, 10:55 AM
#2
Thread Starter
New Member
oh btw, forgot to mention that the problem seems to be the data variable..
-
Mar 10th, 2003, 11:11 AM
#3
Junior Member
Just a guess:
VB Code:
Dim mWnd As Integer
Dim aWnd As Integer
Dim data As String
Dim parms As String
Dim print As Boolean
Dim nopause As Boolean
mWnd = Me.Handle.ToInt32
aWnd = Me.Handle.ToInt32
data = ""
parms = ""
print = True
nopause = True
uptime(mWnd, aWnd, data, parms, print, nopause)
MessageBox.Show(data)
The arrow shot by the archer may, or may not, kill a single person. However, stratagems devised by a wise man, can kill even babes in the womb.
-
Mar 10th, 2003, 01:03 PM
#4
Thread Starter
New Member
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|