want multi-instance com surrogate app
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5

Thread: want multi-instance com surrogate app

  1. #1
    Join Date
    May 2010
    Posts
    3

    want multi-instance com surrogate app

    All,

    I have gone cross-eyed trying to figure out a way.

    The initial issue is that the product I'm working on is going 64-bit, but we have some 3rd party dlls that are 32-bit. The owners of these dlls no longer exist, didn't leave source code nor a forwarding address. As a work-around, I have written com surrogate application wrappers for the dlls. And all works fine.

    However, a new requirement has been placed upon me: the product I work on shall run as multiple instances. The first instance, no problem. The second instance corrupts the data for the first instance. This is because there is only 1 surrogate wrapper application, and the LoadLibrary re-uses the dll handle because of the process space hasn't change. I understand all of the problem.

    The issue is finding a solution. Every time I create an instance of my COM wrapper object, I need a new instance of the surrogate application to be created. I'm missing something, problem stupid, two days of searching and trying and I've gotten cross-eyed.

    Another possible solution that I cannot get to work is to force LoadLibrary to create a new handle for the same process.

    Thanks in advance! The first one to successfully give me an answer gets my steak dinner from Ruth's Chris!
    Craig

  2. #2
    Arjay's Avatar
    Arjay is offline Moderator / MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    11,196

    Re: want multi-instance com surrogate app

    Create a COM exe server wrapper and configure COM to start up a new exe (process) for each new instance.

  3. #3
    Join Date
    May 2010
    Posts
    3

    Re: want multi-instance com surrogate app

    True statement. Now what is the magic on configuring COM?

  4. #4
    Arjay's Avatar
    Arjay is offline Moderator / MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    11,196

    Re: want multi-instance com surrogate app

    This isn't something that I can give you a quick answer to.

    You'll need to research how to register COM applications first, then move to the specifics of single use registration.

    For the single use specifics, search bing or google for "REGCLS_SINGLEUSE COM registration"

  5. #5
    Join Date
    May 2010
    Posts
    3

    Re: want multi-instance com surrogate app

    THANK YOU Arjay!

    When you said "REGCLS_SINGLEUSE", that was the secret that I was looking for. Send me your address and I'll send you my steak dinner. You saved my butt!

    Craig

Posting Permissions

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


Azure Activities Information Page

Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center