Using ROT in VC++

I have a standard 3-tier system programed by VC++, in which there is a Application Server running as Windows Service, and Windows-based desktop application as clients. Client application interfaces with the server via DCOM (App Server runs in a server machine and clients run in Windows 2000/XP desktops). The reason I choose to run the AppServer as Windows service is that the server caches a lot of data, and loading data from DB needs some time, so that I want only one instance is running at any time.

My problem is : sometimes there will be some problems with the server resulting in that it stops responding to clients, so I want to put the server in debug running mode (running it from within Visual Studio) so that I can debug it when problems arise. However, I found that when I debug the server, clients may activate another instance of AppServer.

I looked up in MSDN, guess IMoniker may help me with this: when server is started, it registers all its object to ROT, so that DCOM will always use the current running instance instead of activating another one. However, If I do so, how should I change my client application to get server interface pointers Currently I use CoCreateInstanceEx () method to do so because AppServer runs in another machine.

No such experience before so that any guy could help me with it If you could, it's better to show me details both in client application and in server application.

Thanks a lot !

Kevin



Answer this question

Using ROT in VC++