Groups | Blog | Home
all groups > dotnet compact framework > february 2004 >

dotnet compact framework : P/Invoke Translation tables



Chris Tacke, eMVP
2/27/2004 9:12:33 AM
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.

--
Chris Tacke, eMVP
Co-Founder and Advisory Board Member
www.OpenNETCF.org
---
Windows CE Product Manager
Applied Data Systems
www.applieddata.net


[quoted text, click to view]

Y. Sivaram
2/27/2004 10:36:52 PM
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

Geoff Schwab [MSFT]
3/3/2004 5:16:52 PM
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.
[quoted text, click to view]

Y. Sivaram
3/4/2004 1:15:17 PM
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

[quoted text, click to view]

AddThis Social Bookmark Button