Book a Demo

Author Topic: Automation API problem in C# (EA_GetMenuState)  (Read 3390 times)

Laurent D.

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Automation API problem in C# (EA_GetMenuState)
« 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?

Frank Horn

  • EA User
  • **
  • Posts: 535
  • Karma: +1/-0
    • View Profile
Re: Automation API problem in C# (EA_GetMenuState)
« Reply #1 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)

Laurent D.

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Re: Automation API problem in C# (EA_GetMenuState)
« Reply #2 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!
« Last Edit: May 15, 2008, 06:32:30 pm by ldelaigue »