Trying to read Windows 7 Contacts doesn't work

吃可爱长大的小学妹 提交于 2019-12-11 07:55:32

问题


I based my code on http://msdn.microsoft.com/en-us/library/ms735866.aspx which is quite bugged, after some adaptation of function CreateNewContact() I tried the following.

I don't have errors anymore but nothing is happening :

IClassFactory* pFactory = NULL;
HRESULT rc;
rc = CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
if (rc == S_OK)
    rc = CoGetClassObject(CLSID_Contact,CLSCTX_INPROC_SERVER,NULL,IID_IClassFactory, (void **) &pFactory);
if (rc == S_OK)
    rc = CreateNewContact( pFactory);
if (rc == S_OK)
    wprintf( L"Created\n");

I get "Created" but I don't see any new contact in C:\Users\myself\Contacts but only my existing contacts.

I don't copy CreateNewContact() here as it can be found on the URL.

Any help would be greatly appreciated !

来源:https://stackoverflow.com/questions/10372035/trying-to-read-windows-7-contacts-doesnt-work

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!