I need to marshall this structure in c#.
typedef struct tagSTGMEDIUM
{
DWORD tymed; // this is done
/* do not know how to marshal this part*/
[switch_type(DWORD), switch_is((DWORD) tymed)]
union {
[case(TYMED_GDI)] HBITMAP hBitmap;
[case(TYMED_MFPICT)] HMETAFILEPICT hMetaFilePict;
[case(TYMED_ENHMF)] HENHMETAFILE hEnhMetaFile;
[case(TYMED_HGLOBAL)] HGLOBAL hGlobal;
[case(TYMED_FILE)] LPWSTR lpszFileName;
[case(TYMED_ISTREAM)] IStream *pstm;
[case(TYMED_ISTORAGE)] IStorage *pstg;
[default] ;
};
[unique] IUnknown *pUnkForRelease; // this is done too
}STGMEDIUM;
the problem is that the structure has an union within it and i know that we
cannot have union's marshalled in c#. can anyone please help??
bye