BLS
Joined: 28 Mar 2006 Posts: 44 Location: France
|
Posted: Sat Sep 09, 2006 6:53 pm Post subject: LPVOID, LPCSTR, #pragma pack() Winapi typedef |
|
|
Hi folks,
I am quit weak in C-ish languages. I have to translate a lot of CPP structures similar to the following into D :
#pragma pack(1)
/*Contexte d'enreg pour un fichier*/
typedef struct _stHFFileCtx {
LPVOID pData; /*pointeur vers une structure d'enreg*/
short nSize; /*taille de la structure d'enreg*/
LPCSTR pszNomFic; /*nom logique du fichier associй*/
LPVOID pStorage; /*copie de la structure d'enreg*/
} stHFFileCtx;
typedef stHFFileCtx far * pstHFFileCtx;
......
I think the D version might look similar to :
struct stHFFileCtx {
align(1): //
void* pData; /*pointeur vers une structure d'enreg*/
short nSize; /*taille de la structure d'enreg*/
LPCSTR pszNomFic; /*nom logique du fichier associй*/
void* pStorage; /*copie de la structure d'enreg*/
} ;
alias stHFFileCtx * pstHFFileCtx;
I guess I this translation is full of bugs, so help is really welcome.
btw : winapi typedefs are used.
Thanks in advance.
Björn |
|