M
marfi95
Hi all,
I'm stuck and hope someone out there knows how to get around this.
I have to interface with a 3rd party vendor win32 dll and on one of
their calls, they are returning a bunch of data from a scanned image.
There could be chr(0)'s, etc.... The format they have setup for the
returned data is really funky. Bytes 2-5 is the length of the entire
message. I'm trying to receive it into my vb.net app, but am only
getting partial data back, I'm assuming it's because of the chr(0)
etc...
How do you declare the function in order to receive all the bytes they
are sending. Maybe, I just dont have it setup right.
Here is there exported method:
int WINAPI GetTheData (char *msg, int *Length)
This is the way I have it declared:
Declare Function GetTheData Lib "scandll.dll" (ByVal msg As
StringBuilder, ByRef msgLength As IntPtr) As Integer
I was using a StringBuilder because I thought it was all char data,but
like I said, there could be chr(0)'s in it. Not only am I having a
problem with the msg data itself, but the length when I print it using
msgLength.ToInt32 doesn't seem right either, so I'm not sure if I have
that defined correctly either. For example, when I run their demo, the
length is displayed as 204430, but when I display the IntPtr.ToInt32, I
get 42. The demo code they supplied is in C++ so it doesn't have this
issue, but I need this in vb.net.
Any help would be most appreciated.
Thanks,
Mark
I'm stuck and hope someone out there knows how to get around this.
I have to interface with a 3rd party vendor win32 dll and on one of
their calls, they are returning a bunch of data from a scanned image.
There could be chr(0)'s, etc.... The format they have setup for the
returned data is really funky. Bytes 2-5 is the length of the entire
message. I'm trying to receive it into my vb.net app, but am only
getting partial data back, I'm assuming it's because of the chr(0)
etc...
How do you declare the function in order to receive all the bytes they
are sending. Maybe, I just dont have it setup right.
Here is there exported method:
int WINAPI GetTheData (char *msg, int *Length)
This is the way I have it declared:
Declare Function GetTheData Lib "scandll.dll" (ByVal msg As
StringBuilder, ByRef msgLength As IntPtr) As Integer
I was using a StringBuilder because I thought it was all char data,but
like I said, there could be chr(0)'s in it. Not only am I having a
problem with the msg data itself, but the length when I print it using
msgLength.ToInt32 doesn't seem right either, so I'm not sure if I have
that defined correctly either. For example, when I run their demo, the
length is displayed as 204430, but when I display the IntPtr.ToInt32, I
get 42. The demo code they supplied is in C++ so it doesn't have this
issue, but I need this in vb.net.
Any help would be most appreciated.
Thanks,
Mark