|
-
October 22nd, 1998, 10:24 AM
#1
vb & c++ & COM & automation
Can I return the IUnknown pointer of a typelib's coclass or do I have to return the default interface pointer specified in my idl file? For example:
coclass MyCollection
{
[default] dispinterface IMyInterface;
interface IMyOtherInterface;
}
is a collection object I am exposing to vb automation clients from my c++ app. When accessed, I create my COM object and return its IUnknown.
But I am having problems with certain vb syntax when traversing the returned collection. If the vb code uses either the "for each object" or "MyCollection.Item(index)" syntax, everything is fine. But if I try to use "MyCollection(index)", vb calls the wrong function on MyCollection.
Neither my "Automation Programmer's Reference" book nor C++ documentation say what is expected to be passed from the server but from what I have read I am coming to the belief that I always have to return the default interface of any coclass in the typelib.
-
October 22nd, 1998, 12:18 PM
#2
Re: vb & c++ & COM & automation
You should post this topic in the Visual C++ board on codeguru.com, not in the Visual Basic board here...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|