C++ 使用CoCreateInstance函数打开Mozilla Firefox。怎么办?
早上好 在我的C++代码中,我想通过Mozilla Firefox来打开一个网页,而不需要更多的Internet Explorer。我该怎么办C++ 使用CoCreateInstance函数打开Mozilla Firefox。怎么办?,c++,iwebbrowser2,C++,Iwebbrowser2,早上好 在我的C++代码中,我想通过Mozilla Firefox来打开一个网页,而不需要更多的Internet Explorer。我该怎么办 std::string post = utils::to_html_string(postData); if (SUCCEEDED(OleInitialize(NULL))) { IWebBrowser2* pBrowser2; CoCreateInstance(CLSID_InternetExplorer, NULL, CLSC
std::string post = utils::to_html_string(postData);
if (SUCCEEDED(OleInitialize(NULL)))
{
IWebBrowser2* pBrowser2;
CoCreateInstance(CLSID_InternetExplorer, NULL, CLSCTX_LOCAL_SERVER,
IID_IWebBrowser2, (void**)&pBrowser2);
if (pBrowser2)
{
GEMLOG(InfoLevel, std::string("void IntegratedBrowser::GoTo(" + website + ")").c_str(), "Displaying web page");
long rc = DisplayPOST(pBrowser2, (char*)website.c_str(), (char*)post.c_str(), (char*)header.c_str());
GEMLOG(InfoLevel, std::string("void IntegratedBrowser::GoTo(" + website + ")").c_str(), "Calling waitReadyStateComplete");
pBrowser2->Release();
}
OleUninitialize();
}
我从未听说Firefox提供COM服务器。快速搜索显示,他们也没有听说过Firefox COM/OLE服务器。您可以在默认浏览器中找到firefox.exe或打开页面:您确定firefox提供了IWebBrowser2 COM接口的实现吗?我不知道。你能帮个忙吗?如果firefox是默认浏览器,你可以在url上用一个“open”动词