Board index » cppbuilder » Problems using ActiveX control events containing VARIANT parameters

Problems using ActiveX control events containing VARIANT parameters

Hi,

We imported an ActiveX control with some events. All works fine except those
events which have VARIANT parameters.

Part of the typelib of the ActiveX-control EventInterface

dispinterface _ITestControlEvents {

properties:

methods:

[id(0x00000001), helpstring("method OnSelectionChanged")]

void OnSelectionChanged(

[in] int uid,

[in] VARIANT var);

Quote
}

Debugging revealed, that the events are called correctly with the correct
parameter in TEventDispatch.Invoke method. The VARIANT parameter has the
correct content! But as soon as the generated VCL event-handler is entered,
the content of the appropriate TVariantInParam isn't valid any more!

Does anyone knows about this behavior?

Best regards

Michael

 

Re:Problems using ActiveX control events containing VARIANT parameters


Builder's wrapper code generation feature is very broken.  The use of
TVariantInParam is an example of this brokenness (as well as use of
TVariant and smart interface pointers).  You will probably fix your
problem by replacing TVariantInParam with VARIANT in the Builder
generated wrapper code.

-steve broshar

Quote
Michael B wrote:
> Hi,

> We imported an ActiveX control with some events. All works fine except those
> events which have VARIANT parameters.

> Part of the typelib of the ActiveX-control EventInterface

> dispinterface _ITestControlEvents {

> properties:

> methods:

> [id(0x00000001), helpstring("method OnSelectionChanged")]

> void OnSelectionChanged(

> [in] int uid,

> [in] VARIANT var);

> }

> Debugging revealed, that the events are called correctly with the correct
> parameter in TEventDispatch.Invoke method. The VARIANT parameter has the
> correct content! But as soon as the generated VCL event-handler is entered,
> the content of the appropriate TVariantInParam isn't valid any more!

> Does anyone knows about this behavior?

> Best regards

> Michael

Other Threads