|
-
Jan 21st, 2010, 04:27 AM
#1
Thread Starter
Junior Member
Calling older VB dll (possibly fixed length string)
Hi
Got a dll from a supplier that I need to call. His declaration is
Declaration with Microsoft Visual Basic®:
Declare Function CopyThresholds Lib “OHK43.DLL“ _
(ByVal I_Flags As Long, ByVal I_Ref As String, ByVal I_T0 As Double, _
ByVal I_CR As Single, ByVal I_Range As Long _
ByRef O_TCmin As Double, ByRef O_TCmax As Double, _
ByVal O_Err As String, ByRef O_SzErr As Long) As Long
Buffer variable in calling program:
Dim O_Err As String * 20
Now, the Sting * 20 is clearly not VB.NET, and sure enough it crashes when run - "Attempt to read or write in protected memory" and that leads me to think that there is something with that string definition - or possibly the I_Ref definition which hasn't been defined as fixed length.
I've tried <VBFixedString(20)> when defining O_Err, but I have a feeling that it might not be enough when the function declaration is like that (not specifically fixed length). I cannot figure out how to specify this correctly.
As a small hmmmm, the above is pasted directly from the suppliers documentation, but that't will never work, as there is a "," missing after I_Range as long... Clearly not something he has pasted from a working program...
Comments or suggestions ??
I know - I could contact the supplier, but I'd rather make a complete ass of myself here that with him...
Thanks
Thomas
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
|