Note that there are some explanatory texts on larger screens.

plurals
  1. POCalling a DLL function with more than one return values
    primarykey
    data
    text
    <p>My DLL might send more than one result/return value to exe in one shoot. I still don't understand how to make the callback function so DLL can communicate with host app. </p> <p>Here's the scenario :</p> <p>App :</p> <pre><code>type TCheckFile = function(const Filename, var Info, Status: string): Boolean; stdcall; var CheckFile: TCheckFile; DLLHandle: THandle; Procedure Test; var Info,Status : string; begin .... // load the DLL DLLHandle := LoadLibrary('test.dll'); if DLLHandle &lt;&gt; 0 then begin @CheckFile := GetProcAddress(DLLHandle, 'CheckFile'); if Assigned(CheckFile) then beep else exit; end; // use the function from DLL if Assigned(CheckFile) then begin if CheckFile(Filename, Info, Status) then begin AddtoListView(Filename, Info, Status); end; end; ... end; </code></pre> <p>DLL:</p> <pre><code>function CheckFile(const Filename, var Info,Status: string): Boolean; stdcall; var Info, Status: string; begin if IsTheRightFile(Filename, Info,Status) then begin result := true; exit; end else begin if IsZipFile then begin // call function to extract the file ExtractZip(Filaname); // check all extracted file for i := 0 to ExtractedFileList.count do begin IsTheRightFile(ExtractedFile, Info, Status) then // how to send the Filename, Info and Status to exe ?? // &lt;&lt; edited // SendIpcMessage('checkengine', pchar('◦test'), length('◦test') * SizeOf(char)); error! // "AddtoListView(Filename, Info);" ??? end; end; end; end; </code></pre> <p>Actually I still get an error from code above. So in my case, I need your help to explain and determine what is the correct way to send data from DLL to appp.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload