Hello folks,
I trying to instatiate a activex control, print template from Internet Explorer. The argv[1] parameter it's a path string to a HTML file(like these: c:\MyTemplate.htm). But it seems the type of vTemplatePath don't match and an exception is launched:
Error on line 474 atlbase.h
Expression: p!=0
I'm sorry to post this question here, but I'm a noob in C++. I'm a web programer(PHP, javascript, action script II), and I need very much of this.
Someone can help me to solve this?
Thanks a lot!
//Microsoft reference
//code
int main(int argc, char * argv[])
{
int i;
IOleCommandTarget* pCmdTarg;
CComPtr pWB;
CoCreateInstance(CLSID_WebBrowser, NULL, CLSCTX_INPROC, IID_IWebBrowser2, (void**)&pWB);
pWB->QueryInterface(IID_IOleCommandTarget, (void**)&pCmdTarg);
VARIANT vTemplatePath;
V_VT(&vTemplatePath) = VT_BSTR;
CComVariant vPTPath = argv[1];
pCmdTarg->Exec(&CGID_MSHTML, IDM_PRINTPREVIEW, NULL, &vPTPath, NULL);
return 0;
}
I trying to instatiate a activex control, print template from Internet Explorer. The argv[1] parameter it's a path string to a HTML file(like these: c:\MyTemplate.htm). But it seems the type of vTemplatePath don't match and an exception is launched:
Error on line 474 atlbase.h
Expression: p!=0
I'm sorry to post this question here, but I'm a noob in C++. I'm a web programer(PHP, javascript, action script II), and I need very much of this.
Someone can help me to solve this?
Thanks a lot!
//Microsoft reference
//code
int main(int argc, char * argv[])
{
int i;
IOleCommandTarget* pCmdTarg;
CComPtr pWB;
CoCreateInstance(CLSID_WebBrowser, NULL, CLSCTX_INPROC, IID_IWebBrowser2, (void**)&pWB);
pWB->QueryInterface(IID_IOleCommandTarget, (void**)&pCmdTarg);
VARIANT vTemplatePath;
V_VT(&vTemplatePath) = VT_BSTR;
CComVariant vPTPath = argv[1];
pCmdTarg->Exec(&CGID_MSHTML, IDM_PRINTPREVIEW, NULL, &vPTPath, NULL);
return 0;
}