Re: ExecWB and VARIANT




"RAN" <nijenhuis@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*.

You need to pass a variant array of input parameters, each parameter being a variant.

Without actually testing, the code could look something like:

CComSafeArrayBound bnd (1, 0);
CComSafeArray<VARIANT> p (&bnd);
CComVariant v (L"My filename");
p.Add (v);
CComVariant pars (p);
x->ExecWB(cmdID, cmdexecopt, &p, NULL);


HTH

Brian


.



Relevant Pages

  • Re: ExecWB and VARIANT
    ... void CWebBrowser2::ExecWB(long cmdID, long cmdexecopt, VARIANT* pvaIn, ... I want to SaveAs a webpage using the cmdID = IDM_SAVEAS. ... I don't know how to initialise the VARIANT* pvaIn variable to store ...
    (microsoft.public.vc.mfc)
  • Re: ExecWB and VARIANT
    ... void CWebBrowser2::ExecWB(long cmdID, long cmdexecopt, VARIANT* pvaIn, ... I want to SaveAs a webpage using the cmdID = IDM_SAVEAS. ... I don't know how to initialise the VARIANT* pvaIn variable to store ...
    (microsoft.public.vc.mfc)
  • ExecWB and VARIANT
    ... void CWebBrowser2::ExecWB(long cmdID, long cmdexecopt, VARIANT* pvaIn, ... I want to SaveAs a webpage using the cmdID = IDM_SAVEAS. ... I don't know how to initialise the VARIANT* pvaIn variable to store ...
    (microsoft.public.vc.mfc)
  • Re: completed my Varaint class.
    ... >> I have completed the variant class I have been working on and I wonder ... crap so I am looking into using overloaded template constructors to create ... had supplied an invlaid string parameter, then a null index is created. ... But there's no other way to initialise different types except if the type ...
    (alt.comp.lang.learn.c-cpp)
  • Re: ExecWB and VARIANT
    ... I tried to get it to save without the SaveAs dialog and I ... I don't know how to initialise the VARIANT* pvaIn variable to store ... the OK button the program does not return from the ExecWB method, ...
    (microsoft.public.vc.mfc)