getEnabled = callback signature mismatch error

Jun 2, 2014 at 5:54 PM
Hi all,

It must probably be something very small that I'm missing here, but I can't see what exactly.

In my .dna file, I have the syntax for the ribbon and assign for the first time the getEnabled property to a button.
I've tried several options for the callback's 'returnedVal' but I keep getting the error 'callback signature mismatch'. I've tried ByVal, ByRef, nothing, as Boolean, as Object etc...

Public Sub getEnabled_A(ByVal control As IRibbonControl, ByVal returnedVal as Boolean)
returnedVal = True
End Sub

Any assistance for the correct composition of the callback will be appreciated :-)

Gr,
Raymond.
Coordinator
Jun 2, 2014 at 7:02 PM
Hi Raymond,

VB.NET uses a Function for these callbacks, instead of a Sub like VBA. You can see the full reference for all the callbacks on this page:

In particular, to implement getEnable in VB.NET you'd use the "Visual Basic" signature on that page:
Function GetEnabled(control as IRibbonControl) As Boolean

Regards,
Govert



Jun 2, 2014 at 7:31 PM
Aaaah, alright!
Now everything is cool again :-)
Thank you for the quick response, Govert.

Regards,
Raymond.