oh.
you can
1.
make a mfc app (SDI or MDI ),
add a ATL object in it
modify the CxxxApp::InitInstance()................
if (cmdInfo.m_bRunEmbedded || cmdInfo.m_bRunAutomated)
{
//rem the return
// return TRUE;
}..........................if the com was been call , the window would show.2.
you can use this to get the document.
// Get the document
CComPtr<IOleContainer> spContainer;
m_spClientSite->GetContainer(&spContainer);
CComQIPtr<IHTMLDocument2, &IID_IHTMLDocument2> spDoc(spContainer);
if (spDoc)
spDoc->put_bgColor(CComBSTR(_T("pink")));
其实,我费了这么多话都是没用的, 你去看 MS 的 IEhelper 的例子, 你就全明白了。
good luck .
you can
1.
make a mfc app (SDI or MDI ),
add a ATL object in it
modify the CxxxApp::InitInstance()................
if (cmdInfo.m_bRunEmbedded || cmdInfo.m_bRunAutomated)
{
//rem the return
// return TRUE;
}..........................if the com was been call , the window would show.2.
you can use this to get the document.
// Get the document
CComPtr<IOleContainer> spContainer;
m_spClientSite->GetContainer(&spContainer);
CComQIPtr<IHTMLDocument2, &IID_IHTMLDocument2> spDoc(spContainer);
if (spDoc)
spDoc->put_bgColor(CComBSTR(_T("pink")));
其实,我费了这么多话都是没用的, 你去看 MS 的 IEhelper 的例子, 你就全明白了。
good luck .
解决方案 »
- 学习《Windwos程序设计》时,在17-1节PICKFONT程序中遇到的关于SendMessage的问题
- 客户端connect成功,确没有收到FD_CONNECT消息。客户端怎么固定端口和得到端口?
- 为何我用D3D绘2D图像效率还不如DDraw?
- 在线等前辈赐教 如何画以下一条直线?万分感谢
- 无线网络编程~有做过的人吗?
- 关于ADO连接数据库并写数据库CPU利用率的问题
- 急急急!!!请问MsChart上鼠标单击或者移动抛出什么消息,如何响应?不用MFC类向导
- 朋友们,谁知道怎样才能得到网页的验证码,用什么方法得到,最好给个源代码或提示
- 如何用自定义的菜单来实现多文档中的File\Open?请教高手
- 屏幕之显示
- 如保继承一个Dialog
- 怎样分发ATL控件?
我想用JAVASCRIPT来启动COM,但JAVASCRIPT执行完,COM对象消失,COM就退出了。有没有办法解决这个问题?
will have you ,
COM对象消失,窗口没关的话,进程不会结束。小伙, 好好干。