Returning Structures from activex objects

From: Ayhan Eren (Ayhan_at_iha.com.tr)
Date: 10/28/03


Date: Tue, 28 Oct 2003 16:28:12 +0200


 have a structure as seen below and want to fill the structure with a
function of an activex component.

PCLIP_PARAMETERS =^CLIP_PARAMETERS;
CLIP_PARAMETERS = Record
 // multiplex
 MuxFormat:Integer ;
 MuxBitRate:DWORD ;
 // video
 VideoCount:integer ;
 Video : array [0..MAX_VIDEO_LIST] of CLIP_VIDEO_PARAMETERS ;

 // audio
 AudioCount:integer ;
 Audio:array [0..MAX_AUDIO_LIST] of CLIP_AUDIO_PARAMETERS;
 end;

Given function ise
function GetActiveProperties(out FileName: WideString; nSize: SYSINT; var
Params: Smallint;
                                 StreamIndex: Integer): Integer; safecall;
and Params of this function shoud return the above structure. How should I
call this function to get the structure filled.

documantation of the function is as fallows;

BOOL GetActiveProperties (

/*[out]*/ BSTR *FileName,

int nSize,

/*[in, size_is(nSize / 2 + 1)]*/ short Params[],

long StreamIndex

)

Return value:

TRUE if an active clip is found that contains at least (StreamIndex + 1)
streams.

Parameters:

/*[out]*/ BSTR *FileName -

This is a pointer, which receives the name of the stream in the active clip

int nSize -

This is the size of the Params structure

/*[in, size_is(nSize / 2 + 1)]*/ short Params[]-

This is a pointer to the CLIP_PARAMETERS structure, receiving the MPEG
properties

of the selected stream.

long StreamIndex -

Describes the index of the stream in the clip. In non-split clips this index
should be 0.

Remarks:

FileName must be freed if the method returns TRUE. To free FileName, call

SysFreeString.

when I import the activex then this function is seems as

function TOptibasePlayerAxCtl.GetActiveProperties(out FileName: wideString;
nSize: SYSINT;
                                                  var Params: smallint;
StreamIndex: Integer): Integer

thanks
ayhan