delphi - Updating Inno Setup progress bar from Dephi DLL -


i need help, please. i'm trying call function dll written in delphi 10 seattle inno setup (ansi). not understand problem. if make application in delphi , call function dll, works perfectly! see code listing:

delphi dll:

function process(pb: tprogressbar): integer; stdcall; var   i: integer; begin   := 0 1000   begin     pb.position := i;     pb.update;     sleep(10);   end; end;  exports   process; 

inno setup (ansi):

function count(progr: tnewprogressbar): integer; external 'process@files:callc.dll stdcall delayload';  procedure newbutton1click(sender: tobject); begin    count(newprogressbar1); end; 

after call access violation. but, comment in dpr file read, sharemem write first line, 0 effect.

show me how correctly update progress bar in inno setup delphi dll, please.

you cannot call object methods way. may lucky working, if use same version of delphi 1 inno setup built with, tests delphi application shows. still wrong , unreliable, not it. use different delphi version, layout of progress bar class in memory different, hence "access violation".


for particular task, can handle progress bar:

function process(handle: thandle): integer;  var  i: integer; begin   sendmessage(handle, pbm_setrange, 0, 1000 shl 16);   := 0 1000   begin     sendmessage(handle, pbm_setpos, i, 0);        updatewindow(handle);     sleep(10);   end; end; 

in inno setup, call function like:

function count(handle: thandle): integer; external 'process@files:callc.dll stdcall delayload';  procedure newbutton1click(sender: tobject); begin   count(newprogressbar1.handle); end; 

for more advanced tasks, need use callback.

see


Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -