delphi - Forward declarations for record types -


is there such thing in title? i'm trying in part of converting an api structure, , run haven't encountered before:

pfnreadertranslateddispatch = function(var msg: tmsg): bool; stdcall; pfnreaderscroll = function(var prmi: treadermodeinfo; dx, dy: integer): bool; stdcall; treadermodeinfo = record   cbsize: dword;   hwnd: thandle;   fflags: dword;   prc: prect;   pfnscroll: pfnreaderscroll;   fflags2: pfnreadertranslateddispatch;   lparam: dword; end; preadermodeinfo = ^treadermodeinfo; 

those know delphi see obvious problem. how work around this?

i think simplest solution:

pfnreadertranslateddispatch = function(var msg: tmsg): bool; stdcall; preadermodeinfo = ^treadermodeinfo; pfnreaderscroll = function(prmi: preadermodeinfo; dx, dy: integer): bool; stdcall; treadermodeinfo = record   cbsize: dword;   hwnd: thandle;   fflags: dword;   prc: prect;   pfnscroll: pfnreaderscroll;   fflags2: pfnreadertranslateddispatch;   lparam: dword; end; 

indeed, can reaplce var parameter (by-value) pointer parameter. , there no problem declaring preadermodeinfo before treadermodeinfo.


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -