
GIT always return 0 to the registered interface pointer
Hi,
1. Based on my experience and research, I found that the problem is caused
by call the RegisterInterfaceInGlobal() function with an inappropriate
parameter value.
gpGIT->RegisterInterfaceInGlobal((IUnknown *) m_pTimer,CLSID_RemoteTime,
&pdwCookie);
As in the above code, the second parameter should be of the IID of the
interface instead of class id(CLSID_RemoteTime). So as in this case, we can
change the code as the following:
gpGIT->RegisterInterfaceInGlobal((IUnknown *) m_pTimer, IID_IRemoteTime,
&pdwCookie);
2. It's the same with the GetInterfaceFromGlobal method.
3. I'd like to recommend the following articles for your further reference:
http://msdn.microsoft.com/library/en-us/com/cmi_d2l_77e4.asp
http://msdn.microsoft.com/library/en-us/com/cmi_d2l_7lt8.asp
Hope this helps!
Regards,
HuangTM
This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use. ? 2001 Microsoft Corporation. All rights
reserved.