Re: Convert C-Builder program to Delphi?
From: Maarten Wiltink (maarten_at_kittensandcats.net)
Date: 01/27/05
- Next message: Maarten Wiltink: "Re: Get size of an image"
- Previous message: Jeremy Collins: "Re: TStringList with interfaces instead of objects?"
- In reply to: W. D.: "Re: Convert C-Builder program to Delphi?"
- Next in thread: W. D.: "Re: Convert C-Builder program to Delphi?"
- Reply: W. D.: "Re: Convert C-Builder program to Delphi?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 27 Jan 2005 14:56:02 +0100
"W. D." <NewsGroups@US-Webmasters.com> wrote in message
news:41F8884A.539E@US-Webmasters.com...
> [...] Right now this C++ code that I am working on is getting
> bizzare. As far as I can tell, the following code is for
> compatibilty with DLLs.
>
> I Googled just about everyplace I can think of and still
> haven't come up with the proper way to translate these
> to Delphi:
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> #if !defined (DLLFUNC)
> #define DLLFUNC(ret) extern __declspec(dllexport) ret __stdcall
> #endif
>
> DLLFUNC(int) SomeDLL_Open();
DLLFUNC(T) more or less wraps type T so that declaring a function
to return it is also usefully exported from a DLL this source is
linked into.
It is a macro and depends on C preprocessor macros being textual;
also on the syntactical closeness of the relevant C keywords.
Delphi does not have them all next to each other and doesn't have
macros anyway.
Marking functions as exported is done in the project file in Delphi,
quite separate from the function declaration itself. The calling
convention is given by a directive added after the declaration but
it marks up the declaration as a whole, not just the type. (That's
true also for C, but macros don't care.)
Look for "exports" and "stdcall" in the help.
Groetjes,
Maarten Wiltink
- Next message: Maarten Wiltink: "Re: Get size of an image"
- Previous message: Jeremy Collins: "Re: TStringList with interfaces instead of objects?"
- In reply to: W. D.: "Re: Convert C-Builder program to Delphi?"
- Next in thread: W. D.: "Re: Convert C-Builder program to Delphi?"
- Reply: W. D.: "Re: Convert C-Builder program to Delphi?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|