If you have the header files,
have a look at www.drbob42.com as there is an automated conversion program
for C header files - it does most of it for you - it is not 100% correct but
is very good.

Myles.


> -----Original Message-----
> From: [EMAIL PROTECTED]
> [SMTP:[EMAIL PROTECTED]]
> Sent: Wednesday, 16 February 2000 12:49
> To:   Multiple recipients of list delphi
> Subject:      [DUG]:  converting a Visual C DLL to Delphi
> 
> 
> 
> Hi,
> 
> I trying to write a DLL from a Visual C specification and (not really
> knowing C
> much at all) I need a little help with some of the conversion:
> 
> 1) I presume I can convert all the straighforward #Defines into consts?
> 
> 2) Can I convert the macro defines into functions? eg what would:
>      #define AlphaByte(x)   (((x))>>ALPHA_SHIFT)
>     map to?
> 
> 3) there is one particular conditional define that I am not sure about at
> all:
>      #ifndef DLLEXPORT
>      #define DLLEXPORT    __declspec( dllexport )
>      #endif
>     then at the end of the header file there is:
>      DLLEXPORT VisInfo* QueryModule(void);    /* exported DLL */
>    I understand that DLLEXPORT will be replaced with __declspec( dllexport
> ),
> but it's the only place so why bother defining it? And what does it do?
> and can
> I achieve the same thing in Delphi?
> 
> 4) Can I ignore the #pragmas? There is only one (used in a couple of
> places):
> #pragma pack (push, 8) and #pragma pack (pop, 8)
> 
> 5) When compiling are there any special flags etc that I should use to
> ensure
> it's as compatible as possible with a Visual C compiler's output?
> 
> Thanks for any help,
> 
> Phil Middlemiss.
> 
> 
> --------------------------------------------------------------------------
> -
>     New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
>                   Website: http://www.delphi.org.nz
---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz

Reply via email to