Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questiontypedef struct { LPCTSTR champ1; LPCTSTR champ2; }MyStruct; extern "C" AFX_EXT_API MyStruct * GetStruct() { MyStruct * test; test->champ1="salut"; test->champ2="toto"; return test; }
GetStruct:function():pointer;cdecl; /* du code*/ var p : pointer; begin beginp := GetStruct();
typedef struct { LPCTSTR champ1; LPCTSTR champ2; }MyStruct; extern "C" AFX_EXT_API MyStruct * GetStruct() { MyStruct test; test.champ1="salut"; test.champ2="tot"; return &test; }
Mystruct = record champ1 : Pchar; champ2 : Pchar; end; GetStruct:function():Mystruct;cdecl; procedure TForm1.Button1Click(Sender: TObject); var p : Mystruct; begin if @GetStruct<>nil then begin p := GetStruct(); Label1.Caption := p.champ1; Label2.Caption := p.champ2; end; end;