Hi all I am trying to write an Asynchronous socket in an ocx. I have generated the MFC wizard ocx and created 2 new classes -- connect & listen, both derived from CAsyncSocket. From the xxxApp.cpp, I have created the Main Socket which listens to accept connects from clients. I made a call to "WSAAsyncSelect(MainSok,wind->m_hWnd , WM_USER+1,FD_ACCEPT | FD_READ); " also. But I am unable to capture the events to start reading wot is being written to my socket. I have also written code in the OnAccept of my MainSocket to accept connections. But this routine is not being called. How do I now receive data asynchronously??? Please help. Thanks in advance Cheers Raja
shekar_raja
Posts
-
Async Sockets in a COM Dll/OCX -
SharedPropertyGroupManagerHi All, I have 2 executables, say A and B. A uses some activex controls and COM components which I want to use from exe B. I plan to use the SharedPropertyGroupManager for this, say common.dll I plan to host this dll in MTS and set the object pooling property for Min and Max as 1 and 1. This dll will take in pointers to the activex components used by app A to store in the SPGM. I plan to instantiate this dll, common.dll in App 'A' and pass the instantiated activex objects to store in SPGM. I shall instantiate the common.dll from App B and try getting the objects stored by the SPGM. Will this work?? Can someone help me with this? If this will not work, what is the work around? Thanks in advance, Cheers Raja
-
COM Server/ServiceHi Thanks heaps ! I was trying to instantiate an instance using VC++ and CoCreateInstance. Maybe I could not get the CLSID of the class correctly. I used VB client and it works fine ! :-)) Many a thanks, However, can you tell me how to get the CLSID of a class id to use it with the CoCreateInstance. I tried CLSID<>, __uuidof <>, but no luck :-( I tried using the Smart pointers too. Cheers Raja
-
COM Server/ServiceHi All Is it possible to develop a COM server as a/service which would start when a client instantiates an object of it? I know this is possible in theory, but I've tried doing it, by creating a Service using ATL COM Wizard and then adding an ATL Object. From the client, I tried to instantiate an object of this exposed interface. But the service does not start up and the pointer returned to me in the client is NULL. Can anyone help me provide pointers? Thanks in advance, Cheers Raja
-
Sockets and Active XHi Jitendra Thanks so much for clarifying my qn. Wanted to reply to you immediately but could not login to this site :-(( I have realised that when I use a COM dll loaded into my App and wait for Data to receive on my socket (though it is multithreaded, I am using this from VB script of my app), my app hangs until data is recieved. I am now trying to use the Async Method. Could you please help me in this regard? I have generated a COM dll using the ATL COM APP wizard. I inserted a Full control that actually exposes interfaces. I have then defined my own Class, say MySocket derived publicly from AsyncSocket. I now want to use this dll to get notification when there is data to be read, asynchronously. In my interface implementation, I created an instance of MySocket. How do I get notified of the event? Can you email me ur id, so I could send my code to you for better understanding? My email id is shekar_raja@indiatimes.com This is very critical to me, please take time for this. Thanks heaps in advance.... :(( Cheers Raja
-
Sockets and Active XHi All, I am writing a COM Dll in ATL to integrate 2 applications that talk to each other using sockets. I am new to sockets and have a few queries -- I am using the MFC based CSockets to read and write. When the API, "Accept" is used, a new socket is created with the same properties which can be used to write to a target socket. Can we use the same socket for reading data that is being written on my socket ? I would like to spawn different thread for reading and writing. Is it advisable to use the same socket ? Cheers Raja