Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ATL, ActiveX, and aggregation

Status
Not open for further replies.

Impartial

Programmer
Aug 31, 2001
1
CA
Hello,

I want to create a COM object that adds some functionality to a ActiveX
control. I would like this object to "act" like an ActiveX control. That
is, it would be an ActiveX control with my interfaces added. So, I thought
that aggregating my object with the ActiveX control would be the way to go.
My object would have the following interfaces:
IUnknown
IDispatch
IConnectionPointContainer
IMyInterface (or whatever it would be called)

It starts to get tricky when you consider the fact that the ActiveX control
also has IDispatch and IConnectionPointContainer interfaces. I was thinking
I could implement some sort of IDispatch and IConnectionPointContainer
forwarding in my object by overriding the implementations provided by ATL.
But upon examining the IDispatch interface I realized a few things.
1. The GetTypeInfoCount method can only return 0 or 1. So therefore, I
would have to also create a ITypeInfo implementation that can return
information from both objects.
2. What if the 2 objects have DISPIDs that are the same? I guess I have
control over this in my object so I could make sure that they were unique.

Anyway, it seems like a HUGE amount of work just to get this type of
aggregation (funny how that word is so close to aggrevation) to work (if not
impossible).

Am I approaching this in a completely dumb manner? I am very new to this
stuff. Is it really possible that any 2 objects that are aggregated that
have disp interfaces cause this much hassel? Any help would be greatly
appreciated.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top