Help me ... oh powerful COM gods!! :)
How do I define the following structure in ASM?



typedef struct tagSTGMEDIUM
{
DWORD tymed;
[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;
}STGMEDIUM;
typedef STGMEDIUM *LPSTGMEDIUM;


Any help will be much appreciated

Cheers
Random
Posted on 2001-11-28 07:42:08 by random
forget about that stuff between [].

Just declare:

LPSTORAGE typdef ptr IStorage
LPUNKNOWN typdef ptr IUnknown

STGMEDIUM struct
tymed dword ?
union
hBitmap HBITMAP ?
hMetaFilePict HMETAFILEPICT ?
...
pstg LPSTORAGE ?
ends
pUnkForRelease LPUNKNOWN ?
STGMEDIUM ends

LPSTGMEDIUM typedef ptr STGMEDIUM
Posted on 2001-11-28 09:33:57 by japheth