0

I have written a COM object using C++.

Creating the object and connecting to its events works fine if I do them both at the same time (Javascript):

var obj = WScript.CreateObject("SomeCOMClass.Object", "event_");

However the following generates this error (msdn): http://msdn.microsoft.com/en-us/library/a7tya2wc(VS.85).aspx.

var obj = WScript.CreateObject("SomeCOMClass.Object");
WScript.ConnectObject(obj, "event_");

The error description page does not describe why I cannot connect to already created objects. I would like to be able to connect to created objects because I plan on returning objects from various C++ COM functions.

1 Answer 1

1

I just found an old blog post by Eric Lippert describing this: http://blogs.msdn.com/ericlippert/archive/2005/02/15/373330.aspx

Essentially, he says you need your objects to implement IProvideClassInfo or IProvideMultipleClassInfo in order for WScript to harvest type info about the outgoing (callback) interfaces, so it can set up a matching handler.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.