I'm stuck. There's a 3rd party dll(not COM) called rscw32.dll that
communicates with a Tandem computer(I know HP bot em but it still a
Tandem to me). I'm trying to create my own .net dll that utilizes the
rscw32.dll so others can communicate with the Tandem. The users of my
dll will want to send varying message formats. The problem comes in
with the
'declare' . The 3rd party dll prototype looks like:
USHORT RscWriteRead(ULONG ulOpt1 in
ULONG ulOpt2 in
ULONG ulOpt3 in
char *pcServername in
SHORT siHandle1 in
VOID *pvMsgGoingToTandem
in
USHORT uWriteSize
in
VOID *pvMsgComingFromTandem
out
USHORT *puMsgSizeFromTandem);
in/out
A vb6 declare that works great looks like:
Declare Function RscWriteRead% Lib "C:\RSC\rscw32.DLL" Alias "RSCWR"
(ByVal ulOptions&, ByVal ulConnect&, ByVal ulSession&, ByVal
pcServerName$, ByVal nIo%, pvRequestBuffer As Any, ByVal uRequestSize%,
pvReplyBuffer As Any, puReplySize As Any)
I've got the vb.net piece working by declaring the function like:
Declare Function RscWriteRead Lib "C:\RSC\rscw32.DLL" Alias "RSCWR"
(ByVal ulOptions As UInt32, ByVal ulConnect As UInt32, ByVal ulSession
As UInt32, <MarshalAs(UnmanagedType.LPStr)> ByVal pcServerName As
String, ByVal nIo As Short, <MarshalAs(UnmanagedType.LPStr)> ByVal
sRequest As String, ByVal uRequestSize As UInt16, ByRef srvReply As
ServerMsg_def, <MarshalAs(UnmanagedType.U2)> ByRef puReplySize As
UInt16) As UInt16
As long as ServerMsg_def matches what the user is needing to send to
the Tandem, all is well, but there can be literally thousands of
different message formats needing sent.
The problem with the way I've got it working is that all users can send
messages to the Tandem but only if their message matches the format of
ServerMsg_def. Any help would be greatly appreciated.