How to use IDM_SPELL or OLECMDID_SPELL with Trident/MSHTML

29 Views Asked by At

How can I invoke Trident's spell checking UI? I know there are IDM_SPELL and OLECMDID_SPELL commands defined, but I haven't been able to make either of them do anything other than return errors.

I've seen both 0x80040104 and 0x80040100 returned from IOleCommandTarget::Exec(), and I've seen E_FAIL returned from IWebBrowser2::ExecWB().

These are the call variations I've tried (with valid objects):

    TStackRef<IOleCommandTarget> srCmdTarget;
    TStackRef<IWebBrowser2> srBrowser;
    VARIANT vLocale, vCancel;

    vLocale.vt = VT_I4;
    vLocale.lVal = 0; //LOCALE_USER_DEFAULT;

    vCancel.vt = VT_EMPTY;

    srCmdTarget->Exec(NULL, OLECMDID_SPELL /*IDM_SPELL*/, nCmdexecopt, &vLocale, &vCancel);
    srBrowser->ExecWB(OLECMDID_SPELL, OLECMDEXECOPT_PROMPTUSER, &vLocale, &vCancel);

Does anyone know the proper way to invoke the Trident/MSHTML spell checking UI? If it makes a difference, I have the Trident/MSHTML control embedded within my native C++ application.

Thanks!

0

There are 0 best solutions below