views:

287

answers:

2

I'm trying to implement the IProvideClassInfo on a C# COM object so it's events can be used from Windows Script Host (WSH). I've managed to implement the interface and trace a call in to my GetClassInfo method. However, hooking up the events fails with "Cannot connect object".

Has anyone managed to do this?

This is my script code (JScript):

function AP_GetActionsResponse () {
WScript.Echo ("AP_GetActionsResponse event"); }

// It fails on this var obj = WScript.CreateObject ("Promotions.Promotion", "AP_");

Help would be much appreciated.

A: 

maybe this tutorial will help you: C# Tutorial - Poking at Event Contents

lsalamon
A: 

Okay I figured it out - You must specify a DispId on the event interface or it doesn't work.

There's no need to implement IProvideClassInfo, but you can if you want.

Alex