657 Subj : Application written in Delphi and dll written in BCB To : borland.public.cpp.borlandcpp From : macz Date : Tue Jan 20 2004 11:47 pm Dear all, I've got application written in Delphi and have to write dll library cooperating with it, but I'm writing this dll using C++ (BCB 5.0 Ent). There are routines declared in application as: function func1(PMyInfo Info): integer; stdcall; . . PMyInfo is declared there as a pointer to TMyInfo declared as TPartInfo = packed record Name1 : Char32; name2 : Char32; Check1 : boolean; Check2 : boolean; Var1 : double; var2 : double; end; TMyInfo = packed record InfoCount : integer; MyArray : array [0..Count-1] of TPartInfo; Check : boolean; end; My questions are as follow: 1. Is this correct export routine from my dll if I write it as: extern "C" int __stdcall __declspec(dllexport) Funkcja1(PMojeInfo) Is this all I've to do for correct export or do I have to set also Calling convention option in Advanced Compiler page? If yes so which one of them? Stdcall? Pascal? 2. Is #pragma pack(1) directive correct way to fit the same sizes of packed record and equivalent struct declared in my dll? If yes is this enough to use this directive only during type declaration or do I have to use this directive also during defining variables and operating with this variables? 3. May I use VCL objects in my dll library? Thank's for help in advance. P.S. Sorry for my english ;) Greetings Mariusz . 0