Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Interop / January 2005

Tip: Looking for answers? Try searching our database.

VARBLK

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
David Moreno - 19 Jan 2005 17:35 GMT
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
}

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.