COleDispatchDriver
jmitchell@cc-mail.derwent.co.uk
Thursday, July 18, 1996
Environment: VC4.1 on Win95
I want to remove a menu item from word using:
ToolsCustomizeMenuBar [.Context = number] [, .Position = number] [,
.MenuType = number] [, .MenuText = text] [, .Menu = text] [, .Add] [,
.Remove] [, .Rename]
I am using a class derived from COleDispatch, created from the word
type library using the class wizard. I am passing the parameters by
position, using a VARIANT containing VT_ERROR/DISP_E_PARAMNOTFOUND for
optional parameters I don't need, which works fine. But I don't know
how to send parameters that don't have a value, like .Remove. I have
tried passing VT_NULL and VT_EMPTY variants, but I get an exception
DISP_E_TYPEMISMATCH. Here's my code:
VARIANT vNull;
VariantInit(&vNull);
V_VT(&vNull) = VT_NULL;
COleVariant vEmpty;
COleVariant vOne(static_cast (1),VT_I2);
COleVariant vNotPassed( static_cast(DISP_E_PARAMNOTFOUND),
VT_ERROR );
COleVariant vZero(static_cast (0),VT_I2);
m_pWordBasic->ToolsCustomizeMenuBar(vOne, vOne, vZero, vNotPassed,
vNotPassed, vNotPassed, vNull, vNotPassed);
Thanks
Justin Mitchell
Ignacio Nicolбs Rodrнguez -- intelnet@cano.com.ar
Monday, July 22, 1996
Hi, Mitchel.
| I want to remove a menu item from word using:
| ToolsCustomizeMenuBar [.Context = number] [, .Position = number] [,
| .MenuType = number] [, .MenuText = text] [, .Menu = text] [, .Add]
[,
| .Remove] [, .Rename]
|
| Thanks
|
| Justin Mitchell
For WordBasic, ".Add", ".Remove" and ".Rename" does not mean "those are
parameters and I have nothing to say about them", but "those are boolean
parameters; their value should be TRUE".
The absence of ".Rename" would mean "Rename = FALSE".
Tell me if this was your problem.
--
Ignacio Nicolбs Rodrнguez
Software - Intelnet Argentina
inz@cano.com.ar
| Вернуться в корень Архива
|