CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    May 1999
    Location
    Minnesota, USA
    Posts
    8

    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



  2. #2
    Join Date
    May 1999
    Posts
    2

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured