Where does a VB COM object create an in-proc COM free-threaded COM object?
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: Where does a VB COM object create an in-proc COM free-threaded COM object?

  1. #1
    Join Date
    May 2009
    Location
    UK
    Posts
    10

    Question Where does a VB COM object create an in-proc COM free-threaded COM object?

    I know that if an STA thread creates an in-process COM object whose threading model is Free, the object will be created in the client's MTA, and the creating STA thread will access the object via a marshalled interface pointer. I am clear on this. However, I am not sure what happens if the client is a VB COM object, since I know that VB does not support MTAs? Where will the free-threaded object be created - does COM create the object in an STA instead? If so, is it the same or a different STA than the VB client component?

    What happens if the free-threaded component is created by a C++ client in an MTA, and then the interface pointer is passed to the VB COM object - does the VB COM object create a proxy object in an STA, or can it access objects already created in an MTA? Please help ....

  2. #2
    Join Date
    Aug 2000
    Location
    Essex, Uk
    Posts
    1,214

    Re: Where does a VB COM object create an in-proc COM free-threaded COM object?

    Because you have declared it as in-proc it will get created in the same STA if it wasn't an in-proc, then a NEW STA will be created.
    If you find my answers helpful, dont forget to rate me

  3. #3
    Join Date
    May 2009
    Location
    UK
    Posts
    10

    Question Re: Where does a VB COM object create an in-proc COM free-threaded COM object?

    Thanks :-)

    What happens if a VB COM just tries to access an in-proc COM server object already created in an MTA by another C++ client? Can it call methods on this object in the MTA via a marshalled interface pointer? Or does COM create a proxy in the STA since VB does not support MTAs?

    My in-proc server object needs to be created in an MTA since it has worker threads that need to access it directly. I just want to make sure that my design works and the VB clients are able to access this object if it has already been created in the process MTA.

    If you could solve this little mystery for me, that would be so great as it is driving me mad - I have just been going round and round in circles with this one.

Tags for this Thread

Posting Permissions

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


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center