Thanks. That is one way to solve the problem. But what I am really looking for is a way that COM infrastructure would take care of. What this means is I should not report error to the user, instead return the reference of the already created COM object. If the COM server is launched as service and all users connect to it using CoCreateInstance, they get the same reference. But when the COM server is launched using the current user account, things are screwed up as a second instance is created. Instead COM should not create the second instance, instead return the reference of the COM object hosted in the service. Thanks
http://vivekragunathan.spaces.live.com
Programming is an art. Code is a poem