SDK Ribbon Example Error/Workaround?

Started by paulv45, September 28, 2010, 07:19:33 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

paulv45

In Visio 2010 SDK...
Microsoft Visio Code Samples Library
Visual Basic for Applications (VBA)
User Interface
Fluent User Interface
Custom User Interface Implementation
clsRibbon / Ribbon.cls
Public Sub CommandOnAction

Sub signature is:

Public Sub CommandOnAction(ByVal control As IRibbonControl, _
   ByVal cancelDefault As Boolean)

Paramter documentation says:
' cancelDefault     If true, call the built-in command after the custom code
' is complete

I think there are two issues.  First, cancelDefault needs to be ByRef instead
of byVal to pass information back.  Second the documentation should be
If "false" call the built-in command... not If "true"...

If you just change the signature to ByRef it compiles, but not surprisingly
fails silently due to signature mismatch.

It seems to me like the hosting code is wrong so that there is no way to
for the caller to send the value back.  The default value is "true" (by the
repaired definition of "true") so if that's what you want this is fine.  If
you want it to be "false" (repaired definition) there is no way I see to make
this happen.

(1) Am I thinking straight here?
(2) Does anyone see a workaround?

Thanks.

Paul