Re: Pointers, DLL Header files and lots of exceptions?

From: Kevin Oleniczak (kevinoleniczak_at_comcast.net)
Date: 08/26/04


Date: Wed, 25 Aug 2004 21:25:31 -0500


"Rob Kennedy" <me3@privacy.net> wrote in message
news:2p3q3gFeukt3U1@uni-berlin.de...
> Kevin Oleniczak wrote:
> > DECLSPEC_CLASS int get_values(HANDLE hCom, int* error_count, int*
> > total_count);
>
> You need to look through the header file (and everything it #includes,
> recursively) to figure out what DECLSPEC_CLASS means.
>
> > Here's a snippet of the Delphi unit that wraps it:
> >
> > var get_values: function (hCom: THandle; var error_count: integer; var
> > total_count: integer): integer cdecl {$IFDEF WIN32} stdcall {$ENDIF};
>
> When choosing a calling convention, Delphi uses the last one specified.
> In a Win32 program, cdecl is mentioned before stdcall, so Delphi uses
> stdcall. That's only correct if the DECLSPEC_CLASS macro resolves to
> stdcall, though.

#ifdef LOADER_EXPORTS
      #define DECLSPEC_CLASS __declspec(dllexport)
#else
      #define DECLSPEC_CLASS __declspec(dllimport)
#endif

This was also near the top of the header file... not sure what this means
though. Again, I'm simply trying to call functions from a dll that basically
enteracts with the serial port to capture data for a specific device.

Not sure if I mentioned it earlier of now, but I have compiler
"Optimization" turned off as well.

Thanks for everyone's help so far. I plan to look into the CPU window debug
data for a while this evening, although It's been a long time since I did
any assembly. Any tutorials online that specifically discuss CPU window
debugging in Delphi would be greatly appreciated.



Relevant Pages

  • Re: about getting dir and casting
    ... convention (The default for Delphi). ... It'd either use Stdcall (If the writer of the library wanted to make it as easy to use as possible), ...
    (comp.lang.pascal.delphi.misc)
  • Re: problem using delphi dll in vc++
    ... calling convention to a c++ way? ... It's not enough to add __stdcall to the .h file, ... Delphi can handle that. ... Some Delphi floating point types aren't ...
    (microsoft.public.dotnet.languages.vc)
  • Re: Audio
    ... Does anyone know how to address the sound card from a Delphi 5 ...
    (alt.comp.lang.borland-delphi)
  • Re: Records to DLL
    ... So define the records as packed on the Delphi ... > equivalent to force the same packing to be used. ... function Init: Integer; stdcall; ... If I remove __stdcall I can call ...
    (borland.public.delphi.language.objectpascal)
  • Re: Delphi and assembler debugging
    ... CPU window in the options. ... > currently looking for a good debugger. ... > I've got Delphi 6 and I wonder if Delphi could do the job coz I've seen ... > delphi disassembling an executable when an exception occured. ...
    (alt.comp.lang.borland-delphi)