📄 displayengines.cpp
字号:
void DisplayEngines(void)
{
// get the component category manager for this machine
ICatInformation *pci = 0;
HRESULT hr = CoCreateInstance(CLSID_StdComponentCategoriesMgr,
0, CLSCTX_SERVER,
IID_ICatInformation,
(void**)&pci);
if (SUCCEEDED(hr))
{
// get the list of parseable script engines
CATID rgcatidImpl[1];
rgcatidImpl[0] = CATID_ActiveScriptParse;
IEnumCLSID *pec = 0;
hr = pci->EnumClassesOfCategories(1, rgcatidImpl, 0, 0,
&pec);
if (SUCCEEDED(hr))
{
// print the list of CLSIDs to the console as ProgIDs
enum {CHUNKSIZE = 16};
CLSID rgclsid[CHUNKSIZE];
ULONG cActual;
do
{
hr = pec->Next(CHUNKSIZE, rgclsid, &cActual);
if (FAILED(hr))
break;
if (hr == S_OK)
cActual = CHUNKSIZE;
for (ULONG i = 0; i < cActual; i++)
{
OLECHAR *pwszProgID = 0;
if (SUCCEEDED(ProgIDFromCLSID(rgclsid[i], &pwszProgID)))
{
printf("%S\n", pwszProgID);
CoTaskMemFree(pwszProgID);
}
}
}
while (hr != S_FALSE);
pec->Release();
}
pci->Release();
}
else
printf("###error: couldn't load category manager\n");
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -