You can call them from another thread (I have done so in my NM3
application)
        but you must follow the rules of COM threading.  You must marshal
the interface
        in the main thread (that which is associated with main STA) and send
the
        stream (IStream) along as a parameter on the CreateThread() call (or
_beginthreadex()).
        The thread must then create and initialize its own single-threaded
apartment
        and unmarshal the interface from the argument stream.  It is then
free to call
        any method on the marshaled interface.

        If you are interested, start with the Win32 calls:

        CoMarshalInterThreadInterfaceInStream(...)
        CoGetInterfaceAndReleaseStream(...)

        You can also create your application in a multi-threaded apartment,
which would not
        require you do the marshaling (but would require a lot of other work
on your part).




> Are you using multithreading and NM3.0?. If so, be careful
> to call all the NM methods from the main thread because,
> otherwise, in my experience, at least several of them return
> E_FAIL. Just an idea,
> 
> Luciano
> 
> > Hi !
> > 
> > In a message of 15.02.00 Theodor Isporidi wrote to All about 
> > Application Sharing:
> > 
> > Small update to my problem: Further experimentation with 
> > g_pChannelAppShare->GetState and SetState revealed the following:
> > 
> > SetState won't work either. It will always return E_FAIL, no matter 
> > which state I try to set the local user to.
> > 
> > GetState works and returns my current status being NM_SHARE_UNKNOWN, 
> > which according to the SDK means:
> > 
> > NM_SHARE_UNKNOWN 
> > This value represents one of the following conditions: 
> > You do not have sharing enabled. 
> > 
> > The sharing channel is not active. 
> > 
> > You are not in control and you do not have anything shared. 
> > 
> > 
> > That leads to the following questions:
> > 
> > *) How do I check whether I have sharing enabled? How do I enable 
> > sharing?
> > 
> > *) How do I activate the sharing channel? This is not done by 
> > g_pChannelAppShare->SetActive, I have already tried that in the 
> > meanwhile, even though the SDK already said that wouldn't get me 
> > anywhere.
> > 
> > *) How do I get in control or share anything, if neither SetState nor 
> > EnumSharableApp are working?
> 
> 
> -----------------------------------------------------------------------
> http://www.meetingbywire.com/Mailinglist.htm for unsubscribe information
> -----------------------------------------------------------------------
-----------------------------------------------------------------------
http://www.meetingbywire.com/Mailinglist.htm for unsubscribe information
-----------------------------------------------------------------------

Reply via email to