cancel
Showing results for 
Search instead for 
Did you mean: 

STBLLIB.dll Interop to C#

Posted on October 06, 2010 at 11:15

STBLLIB.dll Interop to C#

4 REPLIES 4
xacc
Associate II
Posted on May 17, 2011 at 14:10

Those 'ref' s look wrong. That would imply 'LPBYTE*' (a pointer to LPBYTE).

A preallocated byte[] should suffice.

IOW, just remove the 'ref' keyword from both definitions of the P/Invoke methods.

Posted on May 17, 2011 at 14:10

That definately solved the problem! Now the data looks like it is supposed to when I listen to the com-port. I dunno where I got the ref part from. Is there any good translation tables for datatypes somewhere?

xacc
Associate II
Posted on May 17, 2011 at 14:10

There used to be a nice section on MSDN (cant recall URL).

Else you can try pinvoke.net, but be warned, many examples are just plain wrong.

Posted on May 17, 2011 at 14:10

''many examples are just plain wrong''

Well those are the ones I am trying to avoid ;)

Anyway thanks for the help! Your advice and a driver update on my USB to ComPort adapter seemed to do the trick.