COM object that uses MFC and MFC Socket class 
Author Message
 COM object that uses MFC and MFC Socket class

How would you create a come object that uses MFC Socket classes. I want to
be able to create this object in VB or Excel or whatever and get live data
from a feed that is coming from this socket connection.

I am currently having trouble with the socket calling my com object back
after I connect to it. It is trying to send it to a window handle and I
can't figure out how to create a window inside this atl com object? What
would the parent be? Please Help.

Thanks,
Mike



Wed, 04 Aug 2004 07:41:38 GMT  
 COM object that uses MFC and MFC Socket class
Derive from CWindowImpl<> and specify NULL as the parent window.

Of course if you are using MFC, you could just use a CWnd window...
And why use ATL at all? MFC can implement COM and Automation
interfaces - read TN038 and TN039. There's no point whatsoever
in mixing MFC and ATL... (You can even implement dual interfaces
in MFC, although I don't know the details...)

--
=====================================
Alexander Nickolov
Microsoft MVP [VC], MCSD

MVP VC FAQ: http://www.mvps.org/vcfaq
=====================================

Quote:

> How would you create a come object that uses MFC Socket classes. I want to
> be able to create this object in VB or Excel or whatever and get live data
> from a feed that is coming from this socket connection.

> I am currently having trouble with the socket calling my com object back
> after I connect to it. It is trying to send it to a window handle and I
> can't figure out how to create a window inside this atl com object? What
> would the parent be? Please Help.

> Thanks,
> Mike



Wed, 04 Aug 2004 11:18:11 GMT  
 COM object that uses MFC and MFC Socket class
You could always roll your own socket classes and eliminate MFC and all the
baggage it carries with it altogether.  Socket programming is relatively
simple - I just rolled my own socket class two weeks ago.


Quote:
> How would you create a come object that uses MFC Socket classes. I want to
> be able to create this object in VB or Excel or whatever and get live data
> from a feed that is coming from this socket connection.

> I am currently having trouble with the socket calling my com object back
> after I connect to it. It is trying to send it to a window handle and I
> can't figure out how to create a window inside this atl com object? What
> would the parent be? Please Help.

> Thanks,
> Mike



Thu, 05 Aug 2004 03:46:58 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. COM object that uses MFC and MFC Socket class

2. Is there a MFC Class for using the WebBrowser Control (Without using COM)

3. ending a blocing sockets call (am using MFC's CSocket class)

4. Using mfc with Crstal 8 Com object

5. Problems using an MFC/ATL Multithreaded COM Obj with an MFC app

6. How to pass MFC Classes between two process using COM

7. Saving and retrieving Ole-Automation objects from Dao and MFC using CLongBinary class

8. Saving and retrieving Ole-Automation objects from Dao and MFC using CLongBinary class

9. Problem with scripting context when using VB com object inside VC com object

10. Using COM objects within COM objects

11. Creating a DLL in MFC to store a class not derived from an MFC class

12. Http classes not using mfc classes

 

 
Powered by phpBB® Forum Software