-
-
Save anonymous/04876315636b09f2254a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
long CPluginMgr::m_LoadProtocolPlugins() | |
{ | |
char szFriendlyName[128]; | |
char szClassName[128]; | |
char szTypeFullName[128]; | |
char szID[128]; | |
short nID; | |
int cIDs = 1; | |
CATID IDs[1]; | |
CLSID clsid; | |
CComPtr<ICatInformation> pInfo; | |
if (FAILED(CoCreateInstance(CLSID_StdComponentCategoriesMgr, NULL, CLSCTX_ALL, IID_ICatInformation, (void**)&pInfo))) | |
return -1; | |
IDs[0] = CATID_PROTOCOL; | |
CComPtr<IEnumCLSID> pEnumCLSID = NULL; | |
if (FAILED(pInfo->EnumClassesOfCategories(cIDs, IDs, 0, NULL, &pEnumCLSID))) | |
return -1; | |
m_ProtocolPlugins.RemoveAll(); | |
while (pEnumCLSID->Next(1, &clsid, NULL) == S_OK) | |
{ | |
if ( ReadRegString(clsid, "",NULL,szFriendlyName, sizeof(szFriendlyName)) && | |
ReadRegString(clsid, "VersionIndependentProgID", NULL, szClassName, sizeof(szClassName)) && | |
ReadRegString(clsid, "4ID", NULL, szID, sizeof(szID)) && | |
ReadRegString(clsid, "TypeFullName", NULL, szTypeFullName, sizeof(szTypeFullName))) | |
{ | |
nID = atoi(szID); | |
m_ProtocolPlugins.Add(szClassName,szFriendlyName,nID,clsid, szTypeFullName); | |
} | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment