Source code for a module

NoteAs a VB developer, you need to built a similar module code to declare function and user type. It will be very helpful if you know how to call a function inside a dynamic link library. You need to know some concepts about Microsoft automatic data types and how to pass a string through VB and C/C++ code to do Memory I/O with Visual Basic.

'call INBOUNDRunCmd() of owrm32c.dll
Declare Function inBound _
    Lib "owrm32c" _
    Alias "INBOUNDRunCmd" _
    (ByVal commandline As String) As Integer

 Declare Function outBound _
    Lib "owrm32c" _
    Alias "OUTBOUNDRunCmd" _
    (ByVal commandline As String) As Integer
 ''user defined type to match struct memio in rtp engine
Type MEMIOSTRUCT
    filename As String 'file name for memory redirection
    paddr As String 'data string to in or out
    pbytes As Long 'size of data string in or out
    pbuflen As Long 'set to vbNullString
End Type
'call vb_OUTRUN () in rtpdll.dll which will call OUTRun() of owrm32c.dll
Declare Function vb_OUTRUN _
    Lib "vbrtpdll" _
    Alias "OUTRun_vb" _
    (ByVal commandline As String, ByRef ioStruct_in As MEMIOSTRUCT, ByRef ioStruct_out As MEMIOSTRUCT) As Integer
'call vb_INRUN () in rtpdll.dll which will call INRun () of owrm32c.dllDeclare Function vb_INRUN _
    Lib "vbrtpdll" _
    Alias "INRun_vb" _
    (ByVal commandline As String, ByRef ioStruct_in As MEMIOSTRUCT, ByRef ioStruct_out As MEMIOSTRUCT) As Integer