> 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?

I'd declare your function types so that delphi gives some type-safety when passnig
your function references.

TInitializeEvent = procedure;
TRenderFunctionCallback = function(Video :^LongInt; Width,Height,Pitch :Integer; pVD 
:^VisData):Boolean;
TSettingsCallback = function(FileName :PChar):Boolean;

RVisInfo = packed record // Should this be packed ? What are VC alignment rules...
  Reserved :LongInt;
  PluginName :PChar;
  LRequired :LongInt;
  Initialize :TInitializeEvent;
  Render :TRenderFunctionCallback;
  SaveSettings :TSettingsCallback;
  OpenSettings :TSettingsCallback;
end;

Something like that ;)

--
Aaron Scott-Boddendijk
Jump Productions
(07) 838-3371 Voice
(07) 838-3372 Fax


---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz

Reply via email to