Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Automation error 80040202

9 views
Skip to first unread message

Shamil Salakhetdinov

unread,
Jan 11, 2003, 7:34:27 AM1/11/03
to
Hi All,

I've DELPHI ActiveX Dll with two CoClasses - one of them has main interface
+ returns its internally created instance of the second CoClass. The main
purpose of the second CoClass is to raise COM events. The first CoClass
creates an instance of the second and keeps it internally during application
lifetime...
Client app - VB6 - gets a ref to the instance of the second CoClass by
calling a method of the first CoClass. When it gets one such ref all works
well. But when it tries to get a second ref (to another VB6 object var)
Automation error 8004000202 is fired :( I guess the problem is related to
the fact that my code improperly manages multiple events sinks...

Any proposals how to solve my problem would be greatly appreciated,
Shamil

--
e-mail: sha...@smsconsulting.spb.ru
Web: http://www.smsconsulting.spb.ru/shamil_s


Shamil Salakhetdinov

unread,
Jan 11, 2003, 12:28:07 PM1/11/03
to
Hi All,

I've got subj's solution - the problematic code is:

procedure TPVEvents.Initialize;
begin
inherited Initialize;
FConnectionPoints := TConnectionPoints.Create(Self);
if AutoFactory.EventTypeInfo <> nil then
FConnectionPoint := FConnectionPoints.CreateConnectionPoint(
AutoFactory.EventIID, ckSingle, EventConnect)
else FConnectionPoint := nil;
end;

the correct one is:

procedure TPVEvents.Initialize;
begin
inherited Initialize;
FConnectionPoints := TConnectionPoints.Create(Self);
if AutoFactory.EventTypeInfo <> nil then
FConnectionPoint := FConnectionPoints.CreateConnectionPoint(
AutoFactory.EventIID, ckMulti, EventConnect)
else FConnectionPoint := nil;
end;

The difference is in one parameter value of
FConnectionPoints.CreateConnectionPoint - I use multiple events' sink
clients - so the second parameter should be ckMulti not ckSingle.

Just wanted to start contributing not only acquiring the help from this
newsgroup.
Hopefully my solution isn't 100 times deja' vue...

Shamil


"Shamil Salakhetdinov" <shamil...@mns.ru> wrote in message
news:3e200f99$1...@newsgroups.borland.com...

0 new messages