Hallo,
I have a litle problem with the parameters for a function in a
Delphi library...

function GetDevices(Ids: array of Word; var Devices: array of WideString; var DevicesCount: Byte): HResult; stdcall;

How can I create the array of WideString in C++ and transferre
it correctly? In delphi strings are differently treated. Do I need a savearray?



This is my Code still now.

typedef HRESULT (_stdcall* T_seq8_GetDevices) ( WORD Ids[],BSTR Devices[], Byte *DevicesCount);
T_seq8_GetDevices seq8_GetDevices;
HRESULT hRes;

BSTR Dev[];
unsigned char DevicesCount ;
WORD Ids[2];
Ids[0]=0x8000;
HINSTANCE xxxx::PTULib = 0;
PTULib = LoadLibrary ("conpci.dll");
seq8_GetDevices = (T_seq8_GetDevices) GetProcAddress (PTULib, "GetDevices");

hRes = seq8_GetDevices(Ids,dev,&DevicesCount);

[email protected]