c header to net

ccc

Newcomer
Joined
Dec 13, 2002
Messages
8
What would this function header be if declared in vb.net?

Code:
void LoadUp(LPVOID lpStart, int iStartLen, LPSTR strRes, int nResLen)
I currently have:
Visual Basic:
declare sub LoadUp  ....  (byval lpStart as int32, byval iStartLen as int32, byref strRes as string, byval nResLen as int32)

Its a dll call, what im doing seems to error vb.net and my application just closes without any messages.

Help would be appreciated. :-\
 
Maybe something like this?
Visual Basic:
Declare Ansi Sub LoadUp Lib "whatever.dll" ( _
    <MarshalAs(UnmanagedType.AsAny)> ByRef lpStart As Object, _
    <MarshalAs(UnmanagedType.I4)> ByVal iStartLen As Int32, _
    <MarshalAs(UnmanagedType.LPStr)> ByVal strRes As String, _
    <MarshalAs(UnmanagedType.I4)> ByVal nResLen As Int32)

You must be using System.Runtime.InteropServices.
 
Back
Top