c - Symbol eliminated by linker (Delphi) -


Help! I am receiving this error when viewing the contents of the inbound function parameter in my Delphi 4 application.

The code calls a function in a DLL with 3 parameter (app.handle, pchar, boolean).

The declared function is in externs.pas and has been declared as:

  function AdjustVoucherDifference (hOwner: HWnd; Receipt_ID: PChar; bCommit: Boolean): boolean; Stdcall; External 'FBCoupon.dll' name 'AdjustVoucherDifference';  

In any other source file, the code is called as:

  Adjusted voucher definition (application handle, picar (receipt_ID), true );  

While going through the code in debug mode, I can see valid values ​​in the source file, but when it breaks on the line in externs.pas, the tooltip for values (Or CTRL + F7 ) indicates that the link has been terminated from the linker and the execution is in the dll when I get an exception.

The DLL has been developed in CBuilder4 and the special function is declared as:

  BOOL __stdcall __DLLTYPE__ Adjusted voucher deferment (hwnd homer, four * receipt_ID, Child Commit);  

The compiler optimization is off.

Thanks

  1. set a breakpoint before calling the external function Do not (Breakpoint on External Declaration).
  2. Open the debugger disassembly window. (I've forgotten the exact menu path to get there)
  3. Take a step through the machine instructions at once, you do not need to understand all of them (though it does not hurt), but Keep a quick eye for jumping and call directions.
  4. There will be a slight thunder because the code sets the parameter for the call, then a call command.
  5. Follow the call instruction (step in). Since this is an external call, so expect the indirect instructions leap to see.
  6. Follow that jump to its destination. Now you should be inside C ++ DLL. If you have created DLL in CBLER with debug info, then you have information about the symbol information and source line Should also be.

If your parameter declaration on the Delphi side does not match the expectations C + + side, then you should start looking at the things happening on the C + + side of the call, which ++ Access violation generated by DLL may be due to an exception or runtime error.


Comments