Book a Demo

Author Topic: Some more on starting out with addins  (Read 3435 times)

SomersetGraham

  • EA User
  • **
  • Posts: 376
  • Karma: +1/-0
    • View Profile
Some more on starting out with addins
« on: March 10, 2010, 02:25:36 am »
Hi
I have successfully compiled the c# example CS_AddinFramework and have started to develop an addin around this.
I created a c# class library project and copied the code from the example
I copied all the project settings and set the registry as I did for the example
My namespace is MyAddin and the entry point is Main.
However when I run EA and look at the Addin manager my addin gives and error-not found message.
Does anyone know what I may have done wrong?

Thanks

Graham

PS
Dont know if it is important but I get the following warning when I build my version
c:\WINDOWS\Microsoft.NET\Framework\v3.5\Microsoft.Common.targets : warning MSB3214: "C:\VSProjects\Addin2\bin\Debug\Addin2.dll" does not contain any types that can be registered for COM Interop.
« Last Edit: March 10, 2010, 02:30:32 am by SomersetGraham »
Using V12

Makulik

  • EA User
  • **
  • Posts: 400
  • Karma: +0/-0
    • View Profile
Re: Some more on starting out with addins
« Reply #1 on: March 10, 2010, 02:36:43 am »
A very common mistake I'm doing when implementing the Event handlers in the Main class, was to forget to specify the methods as 'public'. The warning you've got seems important for this context anyway. Check, if you either forgot to make the Main class public or the methods it contains.

HTH
Günther

SomersetGraham

  • EA User
  • **
  • Posts: 376
  • Karma: +1/-0
    • View Profile
Re: Some more on starting out with addins
« Reply #2 on: March 10, 2010, 02:42:54 am »
Hi Günther
Got to the bottom of it
In the assembly info you need to set [assembly: ComVisible] to true

Graham
Using V12

Makulik

  • EA User
  • **
  • Posts: 400
  • Karma: +0/-0
    • View Profile
Re: Some more on starting out with addins
« Reply #3 on: March 10, 2010, 03:07:14 am »
Good that you've found it :D

But don't forget the event handlers, if you're extending the event handlers in future! To me it happened really frequently, because there are no direct calls and the compiler won't complain. You'll just wondering then, why the event handler isn't called from the AI  ;).
Also I found it sometimes tricky to get the right function signatures for them.

WBR
Günther