FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

LPVOID, LPCSTR, #pragma pack() Winapi typedef

 
Post new topic   Reply to topic     Forum Index -> Bindings
View previous topic :: View next topic  
Author Message
BLS



Joined: 28 Mar 2006
Posts: 44
Location: France

PostPosted: Sat Sep 09, 2006 6:53 pm    Post subject: LPVOID, LPCSTR, #pragma pack() Winapi typedef Reply with quote

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
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> Bindings All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group