P/Invoke Translation tables

  • Thread starter Thread starter Y. Sivaram
  • Start date Start date
Y

Y. Sivaram

Hi,

I am a new CF programmer from a VB background.

Now I am trying to get in terms with P/Invoke to get a HP camera working.

One of the major problems I have is that I couldn't find a single source
which says if the C/C++ data type is this, then use this VB.NET data
type/structure. Even though I managed to figure our some simple types (E.g
Hwnd ->IntPtr) there are some complex ones like TCHAR filename[100], which I
couldn't find any easy way. (I am now using a solution given by Geoff to
declare short variables for each element).

Can anybody point me in the right direction?

Best Regards,
Y. Sivaram
 
A TCHAR array will likely marshal as a string or StringBuilder. A byte
array would work too. I suggest looking at other examples of P/Invocation,
which should be pretty easy to find.
 
Thanks Geoff.

Yes it is you!

No. I no longer hard code as short (I had 100 elements to code). Later I
went through the other threads and now implemented it as a class to return
the data as a bytearray.

Best Regards,
Y. Sivaram

Geoff Schwab said:
I couldn't help but respond when I saw my name (I assume). Have you checked
out the example implementation of the WAVEINCAPS where the class is
implemented as a byte array or are you hardcoding shorts?

--
Geoff Schwab
Program Manager
Excell Data Corporation
http://msdn.com/mobility
http://msdn.microsoft.com/mobility/prodtechinfo/devtools/netcf/FAQ/default.aspx

This posting is provided "AS IS" with no warranties, and confers no rights.
Y. Sivaram said:
Hi,

I am a new CF programmer from a VB background.

Now I am trying to get in terms with P/Invoke to get a HP camera working.

One of the major problems I have is that I couldn't find a single source
which says if the C/C++ data type is this, then use this VB.NET data
type/structure. Even though I managed to figure our some simple types (E.g
Hwnd ->IntPtr) there are some complex ones like TCHAR filename[100],
which
I
couldn't find any easy way. (I am now using a solution given by Geoff to
declare short variables for each element).

Can anybody point me in the right direction?

Best Regards,
Y. Sivaram
 
Back
Top