#import "Skype4COM.dll"
int _tmain( int argc, _TCHAR* argv[]) {
// COM
CoInitialize(NULL);
// Skype
SKYPE4COMLib::ISkypePtr pSkype(__uuidof(SKYPE4COMLib::Skype));
// Skype API
pSkype->Attach(6,VARIANT_TRUE);
//
_bstr_t bstrSkypeVersion = pSkype->GetVersion();
printf( "Skype client version %s\n" , ( char *)bstrSkypeVersion);
// COM ""
_bstr_t bstrWrapperVersion = pSkype->GetApiWrapperVersion();
printf( "COM wrapper version %s\n" , ( char *)bstrWrapperVersion);
//
pSkype = NULL;
CoUninitialize();
return 0;
}
pSkype->Attach(6, VARIANT_TRUE);
#import "Skype4COM.dll"
using namespace SKYPE4COMLib;
int _tmain( int argc, _TCHAR* argv[]) {
CoInitialize(NULL);
ISkypePtr pSkype(__uuidof(Skype));
pSkype->Attach(6,VARIANT_TRUE);
IChatMessage *message;
message = pSkype->SendMessage(_bstr_t(L "user_name" ), _bstr_t(L "" ));
printf( "%s sent message" , ( char *)message->FromHandle);
pSkype = NULL;
CoUninitialize();
return 0;
}
ICallPtr pCall = pSkype->PlaceCall(_bstr_t(L"user_name"), L"", L"", L"");
IUserCollectionPtr contactList = pSkype->GetFriends();
for ( int i = 1; i <= contactList->GetCount(); i++) {
_bstr_t bstrHandle = contactList->GetItem(i)->GetHandle();
_bstr_t bstrFullname = contactList->GetItem(i)->GetFullName();
printf( "Friend login %s and name %s \n" , ( char *)bstrHandle, ( char *)bstrFullname);
}
Source: https://habr.com/ru/post/72059/
All Articles