Book a Demo

Author Topic: Error when calling Addin  (Read 3847 times)

mark.tootell

  • EA Novice
  • *
  • Posts: 13
  • Karma: +0/-0
    • View Profile
Error when calling Addin
« on: August 15, 2011, 07:13:29 am »
Hi all
The C# addin I wrote to provide me with the utility functions I needed to generate my c++ code via the code generation template (see previous posts) is generating an error:

An error occurred while attempting to communicate with an addin:
CS_Addin(CS_Addin.Main)
"GetSignals: Invalid Parameters"

The Addin function that I am calling is declared as:

public object GetSignals( EA.Repository Repository, object[] args)
{
       object retObj;

       // Does stuff with strings

       return retObj;
}


and I call the Addin function from within the code generation template like this:

$opCode = %EXEC_ADD_IN("CS_Addin", "GetSignals", classGUID, classStereotype, ...)%

Can anyone tell me what I am doing wrong? and more to the point how I can fix it?

Thanks

Mark

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Error when calling Addin
« Reply #1 on: August 16, 2011, 04:26:11 pm »
Mark,

The error says "invalid parameters"
Your operation requires a parameter of type EA.Repository, but I don't see you passing that anywhere (or is that done by EA?)
Isn't there somewhere  simple example available?

Geert

mark.tootell

  • EA Novice
  • *
  • Posts: 13
  • Karma: +0/-0
    • View Profile
Re: Error when calling Addin
« Reply #2 on: August 17, 2011, 05:27:08 am »
Hi Geert
Yes, the repository is passed by EA when the add-in function is called. Sparx support has come back with the solution. The function parameters needed to be as follows:

object GetSignals( EA.Repository Repository, object args)
{
}


The square brackets have been removed - simply as that.   :-?
Regards

Mark