views:

1028

answers:

2

Following on from this question here

I have a custom ActiveX control which raises an event "BeforePageValidated" which has a parameter "args" which is an object which contains a boolean. The purpose of this is to allow the client to override the validation and force it fail by setting the boolean value to true.

I can catch the event in IE using the following

<script for="objInterviewNOW" event="BeforePageValidated(args)">

However I can't access the property of the args object.

How should I be doing this?

+1  A: 

Worked it out for myself.

The problem was that the event was being passed down from another dll used by the activeX control, and this is where the args class was declared.

Fixed it by creating a copy of the args class in the activeX object and using this when raising the event.

Unfortunately does mean the args class is duplicated, so maybe someone knows a better way?

A: 

args also needs to register as com object.

[ComVisible(true)]
[GuidAttribute("xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx")]
public class args
{

}

Hope this will help.