CoInitialize(NULL);
GCalender::IGCalenderSync* pGCalender;
HRESULT hr = CoCreateInstance(__uuidof(GCalender::GCalenderSyncHelper),NULL,
CLSCTX_INPROC_SERVER,__uuidof(GCalender::IGCalenderSync),(void**)&pGCalender);
GCalender::GenericEvent HUGEP *pDeletedEvents;
GCalender::GenericEvent HUGEP *pUpdatedEvents;
GCalender::GenericEvent HUGEP *pNewEvents;
SAFEARRAY* deletedEvents, *updatedEvents, *newEvents;
pGCalender->GetAllEvents(&deletedEvents, &updatedEvents, &newEvents);
hr = SafeArrayAccessData(newEvents, (void HUGEP* FAR*)&pNewEvents);
SafeArrayUnaccessData(newEvents);
hr = SafeArrayAccessData(deletedEvents, (void HUGEP* FAR*)&pDeletedEvents);
SafeArrayUnaccessData(deletedEvents);
hr = SafeArrayAccessData(updatedEvents, (void HUGEP* FAR*)&pUpdatedEvents);
SafeArrayUnaccessData(updatedEvents);
CoUninitialize();
in the above code the HR value is 0X8007002 ( system cannot find the file specified) How to resolve thi开发者_StackOverflow中文版s.
That happens if the COM server for the class id you passed into CoCreateInstance()
is registered, but for whatever reason the .dll file or one of its dependencies can't be found. Your best bet is Process Monitor utility - it will let you see what file exactly is missing.
精彩评论