Sparx Systems Forum

Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: Laurent D. on May 15, 2008, 05:55:44 pm

Title: Automation API problem in C# (EA_GetMenuState)
Post by: Laurent D. on May 15, 2008, 05:55:44 pm
Hello,

I'm using C# to write an add-in, and I have some problem with the EA_GetMenuState() API:
I'm supposed to use IsEnabled = false to disable my menu, but I'm afraid that the Boolean parameter is immutable in C#, so my modification is not "seen" by EA.
Am I mistaken? Has anybody experienced this too?
Title: Re: Automation API problem in C# (EA_GetMenuState)
Post by: Frank Horn on May 15, 2008, 06:10:53 pm
Why should it be immutable? The signature in C# is

Code: [Select]
public void EA_GetMenuState(EA.Repository Repository, string Location, string MenuName, string ItemName, ref bool IsEnabled, ref bool IsChecked)
Title: Re: Automation API problem in C# (EA_GetMenuState)
Post by: Laurent D. on May 15, 2008, 06:13:20 pm
Oh thanks, I was not using the right signature!
 ::)
I'm trying this right now, but of course it should be all right now.

Edit: Indeed, I have change the signature and everything works fine now. Thanks again!