Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

IMessengerAdvanced StartConversation returns E_FAIL

9 views
Skip to first unread message

ImaCoffeeDrinker

unread,
Jun 22, 2009, 1:06:01 PM6/22/09
to
Hi,

I’m trying to add a "Share Information using Live Meeting" option to my
application. My thought was that I could have a list of pre-configured
contacts. The user would simply select one or more contacts from the list,
and my application would start the meeting using the Office Communicator SDK.

My app is a C++ app. I can successfully create an instance of the Messenger
and get a pointer to its IMessengerAdvanced interface. I can call
get_MyFriendlyName(&myName). This returns my name, so I know that I’m able to
successfully talk to the Messanger. When I call StartConversation with a
conversation type of IM or LIVEMEETING, I’m returned E_FAIL.
I’ve tried several different formats for the BSTR contact argument to
StartConversation. I’ve removed my real contact information for the purposes
of this posting, but formats I’ve tried include:
SIP:My.Co...@MyCompany.com
sip:My.Co...@MyCompany.com
My.Co...@MyCompany.com
I’ve also tried a Null argument. According to the documentation, “When no
participants are provided, a contact picker is used to prompt for the user
input of participants.”
Under all circumstances, StartConversation returns E_FAIL.
The documentation says E_FAIL means that “The method is called against the
local user.”
(StartConversation documentation can be found here:
http://msdn.microsoft.com/en-us/library/bb787232.aspx )
My.Co...@MyCompany.com isn’t myself, it’s someone I can see in the Office
communicator contact list. I can start a LiveMeeting or IM them via the
Office Communicator UI.
I don’t guess I understand what “The method is called against the local
user.” means.
If anyone might know the issue here, I would greatly appreciate the help.
Thanks
My code follows.

HRESULT hr;
IMessenger *pIMessenger = NULL;
IMessengerAdvanced *m_pIMessenger = NULL;
CoInitialize(0);
hr = CoCreateInstance(CLSID_Messenger, NULL, CLSCTX_ALL, IID_IMessenger,
(LPVOID *)&pIMessenger);
pIMessenger->QueryInterface(IID_IMessengerAdvanced, (void**) &m_pIMessenger);
if (FAILED(hr))
return hr;
// The IMessenger interface is now ready for use.
BSTR myName;
hr = m_pIMessenger->get_MyFriendlyName(&myName);
BSTR serviceId;
hr = m_pIMessenger->get_MyServiceId(&serviceId);
//setup to call StartConversation
SAFEARRAY* pMyContact;
SAFEARRAYBOUND rgsabound[1]; // 1 dimensional
rgsabound[0].lLbound = 1;
rgsabound[0].cElements = 1; // 1 number
pMyContact = SafeArrayCreate(VT_BSTR, 1, rgsabound);
if (pMyContact)
SafeArrayPutElement(pMyContact,(long *)rgsabound,
SysAllocString(L"SIP:My.Co...@MyCompany.com"));
VARIANT vtMyContact;
VariantInit(&vtMyContact);
vtMyContact.vt=VT_ARRAY;
vtMyContact.parray = pMyContact;
VARIANT tmp; // temp variant for optional input
tmp.vt = VT_NULL;
VARIANT tmph; // used for window handle
tmph.vt = VT_PTR;
//hr = m_pIMessenger->StartConversation(CONVERSATION_TYPE_LIVEMEETING,
vtMyContact, tmp, tmp, tmp, tmp, &tmph);
//hr = m_pIMessenger->StartConversation(CONVERSATION_TYPE_LIVEMEETING, tmp,
tmp, tmp, tmp, tmp, &tmph);
hr = m_pIMessenger->StartConversation(CONVERSATION_TYPE_IM, vtMyContact,
tmp, tmp, tmp, tmp, &tmph);
DWORD lastError;
lastError = GetLastError();
VariantClear(&vtMyContact);
CoUninitialize();

0 new messages