A COM component as a service
I've used the ATL COM wizard of VC++ 5.0 to create a COM server that runs as a service.
The service is able to install and it runs when I try to retrieve an interface. The problem I'm having is that when I use CoCreateInstance to create
an instance of the interface, it returns with the error "Bad variable type."
I've created this server as both a DLL and a non-service EXE. Leaving the client unchanged, CoCreateInstance does not throw an error when using the other two versions. It only errors when the EXE is installed as a service.
Any insight into this problem would be appriciated.
Thanks,
Matt Johnson
Re: A COM component as a service
Check that you have built and registered the proxy dll.
To use the server from a remote client, you need to use CoCreateInstanceEx.
You need to fill out a COSERVERINFO structure, to let DCOM know where to find this server and what security authentication you are going to use.
Hope this helps.
MOS