Hi Cindy,
thanks for your post.
First of all, my problem is not a .NET problem. It's just 'simple' COM.
The object i like to create with VBA is written in C++ with ATL by
myself. The interface definition of the object in IDL looks like this:
[
object,
uuid( 7CB51F73-3AEC-4894-809F-A7EACEC5BBE0 ),
dual,
helpstring( "IContainerManagement" ),
pointer_default( unique )
]
interface IContainerManagement : IDispatch
{
[id(1)]
HRESULT GetSomething( [out, retval] SomeCollection **pCollection );
}
[
object,
uuid(EB82B59A-AB43-4138-8BC2-531BAE1FB75A),
dual,
helpstring("IGroupManagement"),
pointer_default(unique)
]
interface IGroupManagement : IDispatch
{
[id(1), helpstring("InsertGroup")]
HRESULT InsertGroup([in] const BSTR xmlDesc);
}
[
uuid(08899F12-5C59-42C1-B2AD-E51EBD4305AB),
helpstring("TheObject Class")
]
coclass TheObject
{
[default] interface IContainerManagement;
[] interface IGroupManagement;
}
So there are 2 interfaces in one object. It is no problem to access
the second interface if I use early binding, which is possible in all
office components.
Unlucky i have to use the object with another sw which is programmable
via VBA but does not support early binding. So I have to create all
objects via "CreateObject( "AppName.TheObject.1" )". The object I create
this way does only expose the [default] interface (IContainerManagement)
of the coclass TheObject. I'm looking for a way to access the
(IGroupManagement) of TheObject without rewriting the interfaces (if
possible).
Frank Recknagel
Software Service John, Germany
http://www.john-software.de