Главная страница | назад





Article #19401: Implementing the IConnecitonPoint Interface with Builder

 Question and Answer Database

FAQ4401C.txt   :Implementing the IConnecitonPoint Interface with Builder
Category   :ActiveX
Platform    :All-32Bit
Product    :C++Builder3.x,   C++Builder4.x,   

Question:
I don't understand well how C++ Builder 4 implements the
IConnectionPoint interface.

When I check "generate event support" in the ActiveX wizard 
section (i.e.when I start creating interface named "Test" )
I obtain a new dispatch interface named "ITestEvents". In 
the generated code I've a class wrapper too, named 
"TEvents_Test" that fires any methods I add to ITestEvents.

The CoTest creator class implements ONLY ITest interface. 
It seems that CoTest class (ITest interface) does contains 
any reference to TEvents_Test class (ITestEvents interface).

So, what about ITestEvents? When I create an instance of 
CoTest (client), how can manage events?

Answer:
When you import the type library into your client, there should be a 
class named TEvents_Test that you can instantiate and which implements
a ConnectionPoint interface.

The class is templatized, and there isn't an explicit typedef, so you'll
need to do something like typedef TEvents_Test MyEventsWrapper.



2/24/1999 2:02:57 PM
 

Last Modified: 01-SEP-99