一个TCppShellWindows的问题
void __fastcall TForm1::Button1Click(TObject *Sender)
{
TCppShellWindows* explorer;
explorer = new TCppShellWindows(NULL);
VARIANT va;
va.vt=VT_I4;
long lCopies = explorer->get_Count();//为什么这里会出错??
for ( long i = 0; i < lCopies; i++)
{
TVariantInParam va(i);
try {
IWebBrowser2Ptr browser(explorer->Item(va));
if (browser)
{
Memo1->Lines->Add(browser->LocationURL);
Memo1->Lines->Add(browser->LocationName);
}
}catch(...){}
}
}
//////////////出错信息////////
Project test.exe raised exception class EOleSysError with message '类没有注册'.
Process stopped. Use Step or Run to continue.