ATL And VB Callback 
Author Message
 ATL And VB Callback

I want to have a Service (VC++) which has a method (Connect) that receives a
backpointer to the caller. The problem is that the caller is a VB component
who passes an interface through which the VC++ program may execute any
callbacks. i.e. VC++ receives a reference to a VB object.....     Does
anyone know if this is even remotely possible ?

/Johan Eriksson



Fri, 19 Dec 2003 04:14:50 GMT  
 ATL And VB Callback
Hi,
this is possible. pl. check my article on idevresource.com(esp. the vbtimer
sample). you might find it illuminating. :-)

amit.

Quote:

> I want to have a Service (VC++) which has a method (Connect) that receives a
> backpointer to the caller. The problem is that the caller is a VB component
> who passes an interface through which the VC++ program may execute any
> callbacks. i.e. VC++ receives a reference to a VB object.....     Does
> anyone know if this is even remotely possible ?

> /Johan Eriksson



Fri, 19 Dec 2003 07:54:56 GMT  
 ATL And VB Callback
hi,amit:
I search the www.idevresource.com,
and can not find your article.
Please tell me how to find your article?
                       thanks!
                                         Aquan
                                   2001/07/02


Fri, 19 Dec 2003 10:02:22 GMT  
 ATL And VB Callback
Hi,
at www.idevresource.com , try the COM section, it must be there. else
you can also try www.codeproject.com under the ATL section (probably).
In the VB/VC eventing article there a VBTimer sample that might help U.
amit.
Quote:

> hi,amit:
> I search the www.idevresource.com,
> and can not find your article.
> Please tell me how to find your article?
>                        thanks!
>                                          Aquan
>                                    2001/07/02



Sat, 20 Dec 2003 11:48:48 GMT  
 ATL And VB Callback
Absolutely. Unless you are talking about asynchronous calls you can just
call back on that interface w/o any attention to the fact that it is coming
from VB coclass (coclass is a coclass after all in whatever language you
manage to write it) :-)

--
Sanin Saracevic, MCP
Lead Software Architect
Interland, Inc.


Quote:
> I want to have a Service (VC++) which has a method (Connect) that receives
a
> backpointer to the caller. The problem is that the caller is a VB
component
> who passes an interface through which the VC++ program may execute any
> callbacks. i.e. VC++ receives a reference to a VB object.....     Does
> anyone know if this is even remotely possible ?

> /Johan Eriksson



Sat, 20 Dec 2003 13:56:10 GMT  
 ATL And VB Callback
I find it at http://www.codeproject.com/
Thank U :)

Quote:
> Hi,
> at www.idevresource.com , try the COM section, it must be there. else
> you can also try www.codeproject.com under the ATL section (probably).
> In the VB/VC eventing article there a VBTimer sample that might help U.
> amit.


> > hi,amit:
> > I search the www.idevresource.com,
> > and can not find your article.
> > Please tell me how to find your article?
> >                        thanks!
> >                                          Aquan
> >                                    2001/07/02



Sat, 20 Dec 2003 14:30:31 GMT  
 ATL And VB Callback
Thanks Amit !  Finally found the article (Ive read a few other from you,
all very informative). Ill try this stuff
as soon as I get a chance, glanced through the article though and liked what
I saw !  Great stuff !

Do you see any problems regarding several Events in the VB Component ?

Thanks again

/Johan Eriksson


Quote:
> Hi,
> this is possible. pl. check my article on idevresource.com(esp. the
vbtimer
> sample). you might find it illuminating. :-)

> amit.


> > I want to have a Service (VC++) which has a method (Connect) that
receives a
> > backpointer to the caller. The problem is that the caller is a VB
component
> > who passes an interface through which the VC++ program may execute any
> > callbacks. i.e. VC++ receives a reference to a VB object.....     Does
> > anyone know if this is even remotely possible ?

> > /Johan Eriksson



Mon, 22 Dec 2003 04:07:20 GMT  
 ATL And VB Callback
Hmmm....   unfortunately it must be asynchronous....
And to add some extra spice there are 4 different methods in the VC
Component
through which the VB Component may communicate AND 4 corresponding methods
in the VB Component that VC uses to fire the callbacks...

Thanks anyway

/Johan Eriksson


Quote:
> Absolutely. Unless you are talking about asynchronous calls you can just
> call back on that interface w/o any attention to the fact that it is
coming
> from VB coclass (coclass is a coclass after all in whatever language you
> manage to write it) :-)

> --
> Sanin Saracevic, MCP
> Lead Software Architect
> Interland, Inc.



> > I want to have a Service (VC++) which has a method (Connect) that
receives
> a
> > backpointer to the caller. The problem is that the caller is a VB
> component
> > who passes an interface through which the VC++ program may execute any
> > callbacks. i.e. VC++ receives a reference to a VB object.....     Does
> > anyone know if this is even remotely possible ?

> > /Johan Eriksson



Mon, 22 Dec 2003 05:38:03 GMT  
 ATL And VB Callback
Still does not sound like a show stopper. You will definitely experience low
performance since VB coclasses are single threaded, so if you call back from
two different threads within your C++ component calls will be serialized by
COM message dispatcher.

--
Sanin Saracevic, MCP
Lead Software Architect
Interland, Inc.


Quote:
> Hmmm....   unfortunately it must be asynchronous....
> And to add some extra spice there are 4 different methods in the VC
> Component
> through which the VB Component may communicate AND 4 corresponding methods
> in the VB Component that VC uses to fire the callbacks...

> Thanks anyway

> /Johan Eriksson



> > Absolutely. Unless you are talking about asynchronous calls you can just
> > call back on that interface w/o any attention to the fact that it is
> coming
> > from VB coclass (coclass is a coclass after all in whatever language you
> > manage to write it) :-)

> > --
> > Sanin Saracevic, MCP
> > Lead Software Architect
> > Interland, Inc.



> > > I want to have a Service (VC++) which has a method (Connect) that
> receives
> > a
> > > backpointer to the caller. The problem is that the caller is a VB
> > component
> > > who passes an interface through which the VC++ program may execute any
> > > callbacks. i.e. VC++ receives a reference to a VB object.....     Does
> > > anyone know if this is even remotely possible ?

> > > /Johan Eriksson



Tue, 23 Dec 2003 22:54:23 GMT  
 
 [ 9 post ] 

 Relevant Pages 

1. CALLBACK, CALLBACK, CALLBACK?

2. ATL COM object can't get arrays from VB in VB/VC6

3. ATL COM object can't get arrays from VB in VB/VC6

4. When debug ATL/VB client - breakpoints in ATL project become disabled

5. Thread-safe callbacks and VB?

6. Problem with calling VB ActiveX from callback

7. VB callback function, called from a VC DLL, crashes

8. VB, Callbacks and Strings

9. Return values from VB CallBack Function to VC Dll

10. Callback to a VB function

11. Callbacks to VC and VB

12. VB Style Strings and Callbacks in C/C++

 

 
Powered by phpBB® Forum Software