Click here to Skip to main content
15,887,776 members
Home / Discussions / ATL / WTL / STL
   

ATL / WTL / STL

 
GeneralRe: VS2010 CLR double to String, String to double MSVC/C++ methods? Pin
rana ray15-Feb-12 20:03
rana ray15-Feb-12 20:03 
GeneralRe: VS2010 CLR double to String, String to double MSVC/C++ methods? Pin
meace12347-Jan-12 17:57
meace12347-Jan-12 17:57 
GeneralRe: VS2010 CLR double to String, String to double MSVC/C++ methods? Pin
meace123415-Jan-12 22:45
meace123415-Jan-12 22:45 
QuestionWTL/ATL Pin
chithrakochu2-Jan-12 21:03
chithrakochu2-Jan-12 21:03 
AnswerRe: WTL/ATL Pin
Pablo Aliskevicius16-Jan-12 4:17
Pablo Aliskevicius16-Jan-12 4:17 
Questionlisting Office contacts Pin
tasumisra26-Dec-11 0:30
tasumisra26-Dec-11 0:30 
AnswerRe: listing Office contacts Pin
Richard MacCutchan26-Dec-11 6:54
mveRichard MacCutchan26-Dec-11 6:54 
GeneralRe: listing Office contacts Pin
tasumisra26-Dec-11 21:28
tasumisra26-Dec-11 21:28 
Thanks for the reply...

Please find the complete code

C++
<blockquote class="FQ"><div class="FQA">Quote:</div>#include<iostream>
#include <windows.h>
#include <tchar.h>
#include<Iads.h>
#include <ole2.h>


#include "c:\program files\Microsoft Office Communicator\SDK\msgrua.h"

const GUID IID_IMessenger =
{0xD50C3186,0x0F89,0x48f8,{0xB2,0x04,0x36,0x04,0x62,0x9D,0xEE,0x10}};

const GUID CLSID_Messenger =
{0x8885370D,0xB33E,0x44b7,{0x87,0x5D,0x28,0xE4,0x03,0xCF,0x92,0x70}};

const GUID IID_MessengerContacts =
{0xE7479A0F,0xBB19,0x44a5,{0x96,0x8F,0x6F,0x41,0xD9,0x3E,0xE0,0xBC}};

const GUID IID_IEnumVARIANT =
{0x00020404,0x0000,0x0000,{0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x46}};

IMessenger* m_pIMessenger;

IMessengerContact* GetContact(BSTR bstrSigninName);

using namespace std;

int _tmain(int argc, _TCHAR* argv[])
{
	CoInitialize(NULL);
	HRESULT  hr = CoCreateInstance(CLSID_Messenger,NULL,CLSCTX_LOCAL_SERVER,
	IID_IMessenger, (LPVOID *)&m_pIMessenger);

	BSTR myName;
	MISTATUS sMyStatus;

	//hr = m_pIMessenger->get_MyFriendlyName(&myName);
	hr=m_pIMessenger->get_MySigninName(&myName);
	hr = m_pIMessenger->get_MyStatus(&sMyStatus);

	BSTR serviceId;
	m_pIMessenger->get_MyServiceId(&serviceId);

	IDispatch *pContacts;
	IMessengerContacts *pCon;

	if (FAILED(hr))
		return NULL;

	hr = m_pIMessenger->GetContact(myName, serviceId, 
	(IDispatch**)&pCon);
	if(FAILED(hr))
	{
		cout<<"Failed";
	}

	m_pIMessenger->get_MyContacts(&pContacts);
	pContacts->QueryInterface(__uuidof(IMessengerContacts),(void**)&pCon);
	
	long lCount=0;
	pCon->get_Count(&lCount);
	
	CoUninitialize();

	return 0;
}</blockquote>


Bow here i can see the count..now i want to iterate through each contact ..i am not getting right method to do the same.
vikas da

GeneralRe: listing Office contacts Pin
Richard MacCutchan27-Dec-11 0:21
mveRichard MacCutchan27-Dec-11 0:21 
GeneralRe: listing Office contacts Pin
tasumisra27-Dec-11 0:45
tasumisra27-Dec-11 0:45 
GeneralRe: listing Office contacts Pin
Richard MacCutchan27-Dec-11 0:57
mveRichard MacCutchan27-Dec-11 0:57 
GeneralRe: listing Office contacts Pin
tasumisra27-Dec-11 3:18
tasumisra27-Dec-11 3:18 
GeneralRe: listing Office contacts Pin
Richard MacCutchan27-Dec-11 4:50
mveRichard MacCutchan27-Dec-11 4:50 
GeneralRe: listing Office contacts Pin
tasumisra27-Dec-11 5:44
tasumisra27-Dec-11 5:44 
Questionconverting CString to Char[100] Pin
KRISHNARAYALU19-Dec-11 22:30
KRISHNARAYALU19-Dec-11 22:30 
AnswerRe: converting CString to Char[100] Pin
Albert Holguin20-Dec-11 4:56
professionalAlbert Holguin20-Dec-11 4:56 
GeneralRe: converting CString to Char[100] Pin
KRISHNARAYALU20-Dec-11 17:00
KRISHNARAYALU20-Dec-11 17:00 
GeneralRe: converting CString to Char[100] Pin
Richard MacCutchan20-Dec-11 21:37
mveRichard MacCutchan20-Dec-11 21:37 
GeneralRe: converting CString to Char[100] Pin
Albert Holguin21-Dec-11 9:30
professionalAlbert Holguin21-Dec-11 9:30 
GeneralRe: converting CString to Char[100] Pin
Richard MacCutchan21-Dec-11 9:46
mveRichard MacCutchan21-Dec-11 9:46 
AnswerRe: converting CString to Char[100] Pin
stonexin20-Dec-11 18:18
stonexin20-Dec-11 18:18 
GeneralRe: converting CString to Char[100] Pin
stonexin20-Dec-11 18:18
stonexin20-Dec-11 18:18 
GeneralRe: converting CString to Char[100] Pin
jumancollion27-Dec-11 5:08
jumancollion27-Dec-11 5:08 
AnswerRe: converting CString to Char[100] Pin
zwhit9-Jan-12 20:25
zwhit9-Jan-12 20:25 
QuestionConvert MFC dll To UNICODE Pin
MrKBA8-Dec-11 0:04
MrKBA8-Dec-11 0:04 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.