Hi,
I'm trying to set my DLL to work from Delphi and I've encountered a problem.
I have a record which contain 4 other records:
type
Tpx_RenderData = record
RenderParams: Tpx_RenderParams;
SelectionParams: Tpx_SelectionParams;
DrawParams: Tpx_DrawParams;
ShadowParams: Tpx_ShadowParams;
end {Tpx_RenderData};
Now, initializing function should fill this record with initial data.
Here is a function definition:
function speInit(var renderData: Tpx_RenderData): Bool cdecl {$IFDEF WIN32} stdcall {$ENDIF};
function speInit; external 'libSpEngine.dll';
In main form function is called:
var
frmMain: TfrmMain;
renderData: Tpx_RenderData; //(record)
.....
begin
IEGlobalSettings().AutoFragmentBitmap := False;
speInit(renderData);
....
I've traced DLL and it fills renderData.ShadowParams record with some data,
but after DLL function exits, everything inside renderData.ShadowParams is as before. In C++ everything works ok. In Delphi I'm passing renderData record by reference (var) but nothing happens.
When simple record from Delphi is passed to some DLL, everything is Ok.
I'm obviously missing something when nested records are in the game!?
TIA,
Siniša