D
Denis C
Hi,
I have a C library and a VB .NET app using the C library
that I want to use on Windows CE 4.2. I have installed
EVC++ 4.0 and VS .NET 2003. Unfortunately they both
deploy to different emulators. Is it possible to set the
target emulator? Or could I install some other compact
framework environment and compile both programs for that
environment?
Denis C
Here also is the question unanswered from my previous
post concerning C structs containing arrays:
Sorry I forgot to put my name on the last one. I'm
wondering if I'm on the right track for dealing with char
arrays from C in VB.
Here's what I'm going to try:
typedef struct GetLongRTS *GetLongRT;
struct GetLongRTS{
char sval[30];
LONG lval;
};
Public Structure GetLongRTS
Public sval As StringPtr
Public lval As Integer
End Structure
Public Structure StringPtr
Private szString As IntPtr
Public Sub New(ByVal s As Integer)
Me.szString = Memory.AllocHLocal(2 * (1 + s))
End Sub
Public Overrides Function ToString() As String
Return Marshal.PtrToStringUni(Me.szString)
End Function
Public Sub Free()
Memory.FreeHLocal(Me.szString)
End Sub
End Structure
Dim ptr As IntPtr = DBAccessFuncDecl.GetLongVal()
Dim obj As DBAccessFuncDecl.GetLongRTS
obj.sval = New DBAccessFuncDecl.StringPtr(30)
obj = CType(Marshal.PtrToStructure(ptr, GetType
(DBAccessFuncDecl.GetLongRTS)),
DBAccessFuncDecl.GetLongRTS)
Is that the idea??
And then we also have some 2d arrays, char[20][20].
Can this approach work?
Thanks
Denis
..
I have a C library and a VB .NET app using the C library
that I want to use on Windows CE 4.2. I have installed
EVC++ 4.0 and VS .NET 2003. Unfortunately they both
deploy to different emulators. Is it possible to set the
target emulator? Or could I install some other compact
framework environment and compile both programs for that
environment?
Denis C
Here also is the question unanswered from my previous
post concerning C structs containing arrays:
Sorry I forgot to put my name on the last one. I'm
wondering if I'm on the right track for dealing with char
arrays from C in VB.
Here's what I'm going to try:
typedef struct GetLongRTS *GetLongRT;
struct GetLongRTS{
char sval[30];
LONG lval;
};
Public Structure GetLongRTS
Public sval As StringPtr
Public lval As Integer
End Structure
Public Structure StringPtr
Private szString As IntPtr
Public Sub New(ByVal s As Integer)
Me.szString = Memory.AllocHLocal(2 * (1 + s))
End Sub
Public Overrides Function ToString() As String
Return Marshal.PtrToStringUni(Me.szString)
End Function
Public Sub Free()
Memory.FreeHLocal(Me.szString)
End Sub
End Structure
Dim ptr As IntPtr = DBAccessFuncDecl.GetLongVal()
Dim obj As DBAccessFuncDecl.GetLongRTS
obj.sval = New DBAccessFuncDecl.StringPtr(30)
obj = CType(Marshal.PtrToStructure(ptr, GetType
(DBAccessFuncDecl.GetLongRTS)),
DBAccessFuncDecl.GetLongRTS)
Is that the idea??
And then we also have some 2d arrays, char[20][20].
Can this approach work?
Thanks
Denis
..