I have a c struct like this:
typedef struct OB{
unsigned char bCamNum;
unsigned char bResolution;
unsigned short wCRC;
VARBLK(MAX_SIZE) Im;
VARBLK(MAX_SIZE) Te;
} OB;
It comes from a callback that just works fine, but at the moment of
inspecting it, in says "This type can not be marshaled as a structure
field" for the VARBLK fields, i'm trying to marshal them as a
[MarshalAs(UnmanagedType.LPArray,SizeConst=4096)], but i must be
mistaken, maybe i have to marshal them as a intptr..
Can anybody help me ;)?
David Moreno
David Moreno - 19 Jan 2005 18:42 GMT
BTW: VARBLK is a MACRO lke this:
typedef struct tagVARBLKHDR {
int iSize;
} VARBLKHDR;
#define VARBLK(size) \
struct { \
VARBLKHDR Hdr; \
unsigned char Array[(size)]; \
}
#define VARBLK_SIZEOF(arraysize) \
(sizeof(VARBLK(arraysize)))
#define VARBLK_SIZE(block) \
((block).Hdr.iSize)
#define VARBLK_PTR(block) \
((block).Array)
#ifdef __cplusplus
}