Author Topic: Using the EXEC_ADD_IN CGT macro from C#?  (Read 5148 times)

g.makulik

  • EA User
  • **
  • Posts: 355
  • Karma: +0/-0
    • View Profile
Using the EXEC_ADD_IN CGT macro from C#?
« on: April 08, 2009, 09:41:44 am »
Hi,

I tried to implement a custom function for the CGT (Code Generation Template) macro EXEC_ADD_IN(). I have placed an extra method in my C# AddIns Main class, where I have implemented diverse EA event handlers, that already work well. The method signature is as follows:
[size=10]
Code: [Select]
public object GetImportFilepath(EA.Repository eaRepository, object args)[/size]

In the CGT I try to call the method as follows:
[size=10]
Code: [Select]
$relativeFilePath=%EXEC_ADD_IN("EAProtobufAddIn","GetImportFilepath",importClassGuid,"/")%
[/size]

But when debugging, the AddIn method doesn't seem to be called at all and the result of EXEC_ADD_IN is an empty string at this point. I have also tried
[size=10]
Code: [Select]
$relativeFilePath=%EXEC_ADD_IN("EAProtobufAddIn","Main.GetImportFilepath",importClassGuid,"/")%
[/size]
but this yields the same behavior.
Has anyone experience with this? Any help or idea is appreciated.

WBR

Günther

Using EA9.3, UML2.3, C++, linux, my brain, http://makulik.github.com/sttcl/

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8085
  • Karma: +118/-20
    • View Profile
Re: Using the EXEC_ADD_IN CGT macro from C#?
« Reply #1 on: April 09, 2009, 07:51:03 am »
I've posted C# examples several times to this forum.

See http://www.sparxsystems.com/cgi-bin/yabb/YaBB.cgi?num=1207649029/1#1 for one of them.

Makulik

  • EA User
  • **
  • Posts: 400
  • Karma: +0/-0
    • View Profile
Re: Using the EXEC_ADD_IN CGT macro from C#?
« Reply #2 on: April 09, 2009, 06:39:24 pm »
Thanks a lot simon.
I had tried a forum search with EXEC_ADD_IN, but got no results at all :(.

WBR
Günther

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Using the EXEC_ADD_IN CGT macro from C#?
« Reply #3 on: April 09, 2009, 10:29:26 pm »
Quote
...
I had tried a forum search with EXEC_ADD_IN, but got no results at all :(.
...
Strange, since it has been discussed many times.

Make sure the spelling was exact, and try various punctuation options. YABB (the bulletin board software) can be very touchy about search keywords.
No, you can't have it!

Makulik

  • EA User
  • **
  • Posts: 400
  • Karma: +0/-0
    • View Profile
Re: Using the EXEC_ADD_IN CGT macro from C#?
« Reply #4 on: April 10, 2009, 03:07:09 am »
Hi David,

I'm pretty sure that I didn't mispelled 'EXEC_ADD_IN'. Try it (may be copying the term from here), you'll find only this thread as result.
Dunno, may be older threads go out of the search engines scope.

WBR
Günther

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Using the EXEC_ADD_IN CGT macro from C#?
« Reply #5 on: April 10, 2009, 11:42:42 pm »
I just tried it and got hits on 62 different threads.

I suggest you set the search for all posts - the default is posts within the past week. Don't change any of the other settings.
« Last Edit: April 10, 2009, 11:43:08 pm by Midnight »
No, you can't have it!

Makulik

  • EA User
  • **
  • Posts: 400
  • Karma: +0/-0
    • View Profile
Re: Using the EXEC_ADD_IN CGT macro from C#?
« Reply #6 on: April 14, 2009, 05:46:48 pm »
Thanks. My fault was that I didn't use that nifty search form, but just the
"Search the Forum" quick search.

-- It's all there, you just gotta find it ...