i finally got this method to work, here's a tip.. If you are sure there is going to be only one instance of the server, you could use ::OpenEvent() in the client instead of ::CreateEvent(). If the server has not called ::CreateEvent(), ::OpenEvent() (in the client process) will return NULL letting you know that the server is not there or has not created the events yet. If you call ::CreateEvent() in the client, it will create the event dispite what is going on with the server.
I read the program that you wrote and I want to transfer data by mailslot -its seems to be simpler.
anyway when i`m using the mail slot in a server and tries to connect it from a pipe i get access denied... when it was in a normal application it worked fine.
I use the same method for IPC on NT 4.0 SP 4, VC++6.0
I have built two applications, one running as NT service. the other running as a normal Windows application for monitoring the service.
I follow same procedure in both applications. First calling CreateFileMapping() followed by MapViewOfFile(). The problem is if I run NT service first, then run the Windows application, I get a failure saying ERROR_ACCESS_DENIED (05). But this problem doesn't occure if I swap the running order.
if(m_pSharedData == NULL)
//Get ERROR_ACCESS_DENIED here
int error = GetLastError();
sharedMemAllocated = true;
There is no sync. done in the 2 applications. But if that's the culprit, the problem shall happen regardless of the running order. And VC++ document says if file-mapping object already exist, then CreateFileMapping() is equal to OpenFileMapping().
I have a program working using shared memory techniq. I need to run more than one instance of server and client. How can I change name of shared memory handle(If first instance is running) for second instance?. Any help is appreciated.
I have gone through your documentation and I feel that it is no doubt an excellent work in this field.
I wanted to modify this code saying that the client first searches it's local drive say 'c:/' to find the specific file he/she looking for. If the file is not found then he/she searches it in intranet assuming that the client is connected to intranet. If the file is found then it's served to the client else then the client request the remote server for the specif file (movie) of any format say avi or MPEG. If the file is found then it's served to the client else the client specify the URL address from where to download the movie. The server goes to that perticular cite and download the movie into its memory and then accept the request from client....
I hope it sound good but need lot of hard work. So I request you if you can help me giving me with some pointers where I can find the sample code on the implementation of client server technology.