Re: Visual C++ dll to Delphi
Robert Marquardt <[email protected]>
| Newsgroups | gmane.comp.lang.delphi.jedi |
|---|---|
| Message-ID | <[email protected]> |
On Fri, 19 Dec 2003 15:04:25 +0100, you wrote:
>>#pragma once
>
>Dunno
Throw away. Tells the C compiler to include the header only once.
>>#define DllImport __declspec( dllimport )
>>#define DllExport __declspec( dllexport )
Simply exports the function from the DLL:
>>#ifdef __cplusplus
>>extern "C" {
>>#endif
Thess the C++ compiler that it is a C function without C++ name
mangling.
>>typedef struct StructInit {
Ignore the StructInit name. It only has a meaning in C.
>> BOOL enabled;
>> int CommPort;
>> char *Settings;
>>} INIT;
>
>This is a simple record, like this:
>
>Type
>
> StructInit = record
I am sure it should be packed record.
The name is INIT.
> Enabled : Boolean;
BOOL is LongBool
> CommPort : Integer;
> Settings : PChar;
> end;
>
> Init = StructInit;
>
>>typedef void (WINAPI *refreshStatus)(long id, long status);
>
>This is a function template call, like this:
>
>Type
> RefreshStatus = procedure( Id : LongInt;Status : LongInt );stdcall;
>
>Or
>
>Type
> RefreshStatus = function( Id : LongInt;Status : LongInt ) : Pointer;
> stdcall;
This is wrong. It is a procedure.
--
Robert Marquardt (Team JEDI) http://delphi-jedi.org
To unsubscribe from this group, send an email to:
[email protected]
------------------------ Yahoo! Groups Sponsor ---------------------~-->
Buy Ink Cartridges or Refill Kits for your HP, Epson, Canon or Lexmark
Printer at MyInks.com. Free s/h on orders $50 or more to the US & Canada.
http://www.c1tracking.com/l.asp?cid=5511
http://us.click.yahoo.com/mOAaAA/3exGAA/qnsNAA/i7folB/TM
---------------------------------------------------------------------~->
Yahoo! Groups Links
To visit your group on the web, go to:
http://groups.yahoo.com/group/Delphi-JEDI/
To unsubscribe from this group, send an email to:
[email protected]
Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/