Re: ExecWB and VARIANT



On 13 dec, 22:58, "AliR \(VC++ MVP\)" <A...@xxxxxxxxxxxxx> wrote:
Oops, typo detected! ;)

COleVariant Filename(_T("c:\\Temp.html"));
ExecWB(OLECMDID_SAVEAS,OLECMDEXECOPT_DODEFAULT,Filename,NULL);

AliR.

"AliR (VC++ MVP)" <A...@xxxxxxxxxxxxx> wrote in messagenews:tUh8j.53174$eY.31660@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx



How about this:
COleVariant Filename(_T("c:\Temp.html"));

ExecWB(OLECMDID_SAVEAS,OLECMDEXECOPT_DODEFAULT,Filename,NULL);

AliR.

"RAN" <nijenh...@xxxxxxx> wrote in message
news:0d41348b-658b-470c-9193-b166fb9c8b6e@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi,

In want to use the ExecWB method of the webbrowser activeX control
from microsoft.

void CWebBrowser2::ExecWB(long cmdID, long cmdexecopt, VARIANT* pvaIn,
VARIANT* pvaOut)

I want to SaveAs a webpage using the cmdID = IDM_SAVEAS.
I don't know how to initialise the VARIANT* pvaIn variable to store
the pathname of the file to save the webpage. It is a VT_BSTR and
pbstrVal must be initialised, but i dont know how to initialise a
VARIANT*.

Please help.- Tekst uit oorspronkelijk bericht niet weergeven -

- Tekst uit oorspronkelijk bericht weergeven -

I Naviagate to an URL using
o_WebBrowser.Navigate(LPCSTR(t_NavigateRecord.o_URL),0,0,0,0);
When the OnNavigateComplete2 event is called i do:

void CMyPropertyPage1::OnNavigateComplete2(LPDISPATCH pDisp, VARIANT
FAR* URL)
{
// TODO: Add your control notification handler code here

COleVariant Filename(_T("c:\\Temp.html"));

o_WebBrowser.ExecWB(OLECMDID_SAVEAS,OLECMDEXECOPT_DONTPROMPTUSER ,Filename,NULL);


}

The program displays a messagebox displaying nothing, after clicking
the OK button the program does not return from the ExecWB method, and
nothing happens after that!
What am i doing wrong ?
What i want is that ExecWB saves the webpage NOT displaying a SaveAs
dialog using OLECMDEXECOPT_DONTPROMPTUSER. But its not working at all.
.