Hi !

Perhaps someone here might be able to help me out?


Forwarded from Area microsoft.public.internet.activex.conferencing.sdk
Original Author: Theodor Isporidi 
Date : 18.02.00 13:01:07

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?

TI> I have a serious problem trying to program application sharing with
TI> Netmeeting.

TI> I had a good look at the NMShare demonstration program, which runs
TI> fine on my system. If I understood the program correctly, this is
TI> what I need to do:

TI> Step 1: Create the conference manager and a manager notification
TI> object, connect the notification object to the manager and
TI> initialize the manager. Done that, works ok. The only difference I
TI> noticed is that NMShare uses uOptions=0 (=NM_INIT_NORMAL) while I
TI> use NM_INIT_CONTROL. Another thing that might be worth mentioning
TI> is that I used NMCH_ALL for pReserved because NMShare does so too.
TI> The SDK says in the documentation of INmManager::Initialize that
TI> pReserved is not used yet, while in the explanation of the NMCH_*
TI> constants the SDK says that this parameter is used and should
TI> ensure that the requested channels will be created in the
TI> conference. A bit confusing, IMHO.

TI> Step 2: Get an INmChannelAppShare Interface on the Application
TI> Sharing channel, create a notification object for it and connect
TI> it. Store pointers to both in global variables. I did so using code
TI> from NMShare. The important parts:

TI> From the conference notification:

TI> HRESULT STDMETHODCALLTYPE
TI> CConfNotify::ChannelChanged(NM_CHANNEL_NOTIFY uNotify, INmChannel *
TI> pChannel) { INmChannelVideo *pVidChannel; ULONG uCh; IID iid;
TI> HRESULT hr;

TI> pChannel->AddRef();

TI> if (uNotify == NM_CHANNEL_ADDED) { // Sharing if
TI> (HookChannel(pChannel) == S_OK) MessageBox(NULL,"Sharing
TI> enabled!","Info",MB_OK); [other stuff I do in case it's a video
TI> channel, closing the brackets again]

TI> The function HookChannel looks like this:

TI> HRESULT HookChannel(INmChannel * pChannel) { HRESULT hr;
TI> CAppShareNotify * pNotify; INmChannelAppShare * pChannelAs;

TI> ASSERT(NULL != pChannel); hr =
TI> pChannel->QueryInterface(IID_INmChannelAppShare, (void
TI> **)&pChannelAs); if (FAILED(hr)) { // Not an app sharing
TI> channel return hr; } if (NULL != g_pChannelAppShare) {
TI> g_pChannelAppShare = NULL; } g_pChannelAppShare = pChannelAs;
TI> // keep QI ref around

TI>     // Connect to the channel object     pNotify = new
TI> CAppShareNotify();     if (pNotify == NULL)     {         hr =
TI> E_OUTOFMEMORY;     }     else     { hr =
TI> pNotify->Connect(g_pChannelAppShare); if (FAILED(hr)) {
TI> pNotify->Release(); } else { g_pNotifyAppShare =
TI> pNotify; } }

TI> if (FAILED(hr)) { g_pChannelAppShare->Release();
TI> g_pChannelAppShare = NULL; }

TI> return hr; }


TI> Looks familiar to you? Right, it was taken from NMShare. :-)

TI> Up to here everything seems to work. I traced everything step by
TI> step with the debugger. All channel types are created, when it is
TI> the application sharing channel's turn to be created HookChannel
TI> successfully does its work and returns S_OK. The interface pointer
TI> I need is stored in the global variable. I even made sure it is of
TI> the right type by calling GetInterface and that the channel is of
TI> the right type by calling GetNmch, which return the expected
TI> results IID_INmChannelAppShare and NMCH_SHARE.


TI> Step 3: If I didn't miss anything the next step should be to create
TI> an application enumerator to step through all available application
TI> and set the desired sharing status for them. This is done by:

TI> IEnumNmSharableApp *pEnum; hr =
TI> g_pChannelAppShare->EnumSharableApp(&pEnum);

TI> For a reason unknown to me this will always return E_FAIL. The SDK
TI> says there can be only one reason for this:

TI> E_FAIL  In NetMeeting 3, this value includes the condition that
TI> application sharing is not enabled on Windows NT�/Windows 2000. See
TI> the Remarks section following for information about earlier
TI> versions of NetMeeting. 

TI> Remarks In versions prior to NetMeeting 3, if application sharing
TI> is not enabled on the underlying system software,
TI> INmChannelAppShare::EnumSharableApp succeeds, but enumerating the
TI> applications on the local system through IEnumSharableApp::Next
TI> returns S_FALSE because there are none. 


TI> But that can't be since I am using Win98 and NM3.01. And if that
TI> really were the reason the NMShare demo couldn't work either, but
TI> it does.


TI> Does anyone have an idea what possible reasons there could be for
TI> this behaviour? Am I missing something? Could NM_INIT_CONTROL be
TI> the reason? I appreciate any help you can give me, I have already
TI> tried to find the error for more than a week and I'm completely
TI> clueless.


Bye !

Key fingerprint =  67 EE 0B D6 52 0A F0 3E  E3 C7 1A 88 24 B0 EF C8

               <<< PGP 2.6.3i Public Key auf Anfrage. >>>


-----------------------------------------------------------------------
http://www.meetingbywire.com/Mailinglist.htm for unsubscribe information
-----------------------------------------------------------------------

Reply via email to