Can't seem to connect to Dr Dobbs at the moment (I think it's our connection).
In the mean time... ;-)
there is a struct defined as follows:
typedef struct
{
unsigned long Reserved; /* Reserved */
char *PluginName; /* Name of the Plug-In */
long lRequired; /* Which flags
(VI_WAVEFORM|VI_SPECTRUM|SONIQUEVISPROC) to set */
void (*Initialize)(void); /* Called before Plug-In has to Render
*/
BOOL (*Render)( unsigned long *Video, int width, int height, int pitch,
VisData* pVD); /* Function called to Render */
BOOL (*SaveSettings)( char* FileName ); /* Function called to Save the
Settings */
BOOL (*OpenSettings)( char* FileName ); /* Function called to Open the
Settings */
}
VisInfo;
Where Initialize, Render, SaveSettings, and OpenSettings are procedures.
Converting that to a record, the pchar and the longint are fine, but do I have
to declare types of procedure for each procedure given, or will I be alright
just declaring them as type pointer?
Thanks,
Phil.
Myles Penlington <[EMAIL PROTECTED]> on 15/02/2000 14:52:09
Please respond to [EMAIL PROTECTED]
To: Multiple recipients of list delphi <[EMAIL PROTECTED]>
cc: (bcc: Phillip Middlemiss/NZ Forest Research Institute/NZ)
Subject: RE: [DUG]: converting a Visual C DLL to Delphi
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
---------------------------------------------------------------------------
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
Website: http://www.delphi.org.nz