protemus
asked on
Events in COM Server
I have a simple COM object, but I am unable to get its events in a client....
The following lines are the problem in the COM server implementation:
//------------------------
// Initialize
//------------------------
procedure TMyCOMObject.Initialize;
begin
inherited Initialize;
FConnectionPoints := TConnectionPoints.Create(S
if AutoFactory.EventTypeInfo <> nil then
FConnectionPoint := FConnectionPoints.CreateCo
AutoFactory.EventIID, ckSingle, EventConnect)
else FConnectionPoint := nil;
The problem is that AutoFactory.EventTypeInfo is nil.... why is this? How do I make sure my factory knows about my events?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I registered the DLL using the Delphi menu Register ActiveX library.
Then I created a MyComObject using CreateOleObject('MyLib.MyC
Created my event handler object
Connected it to MyComObject using a call to InterfaceConnect
Called TestEvent
But it crashes....