Skip to main content
jens239955_stm1_stmicro
Associate
October 6, 2010
Question

STBLLIB.dll Interop to C#

  • October 6, 2010
  • 4 replies
  • 973 views
Posted on October 06, 2010 at 11:15

STBLLIB.dll Interop to C#

    This topic has been closed for replies.

    4 replies

    xacc
    Associate II
    May 17, 2011
    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.

    xacc
    Associate II
    May 17, 2011
    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.

    jens239955_stm1_stmicro
    Associate
    May 17, 2011
    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?

    jens239955_stm1_stmicro
    Associate
    May 17, 2011
    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.