Book a Demo

Author Topic: New to Add-Ins... Using MS VS.Net 2005 (using VB)  (Read 9029 times)

BioformLivesAgain

  • EA Novice
  • *
  • Posts: 12
  • Karma: +0/-0
    • View Profile
New to Add-Ins... Using MS VS.Net 2005 (using VB)
« on: March 10, 2008, 05:22:42 am »
Could anyone point me to getting a "Hello-World" project/environment setup for an EA Add-In... the online help files don't seem to tell me enough, or I am too in-experienced...

Thanks,

David

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: New to Add-Ins... Using MS VS.Net 2005 (using
« Reply #1 on: March 10, 2008, 08:25:03 am »
Hi (other) David,

Step one: Don't Panic! [With thanks to Douglas Adams for teaching us all that.]

This is not too difficult to do, but rather difficult to explain. So please help me out a bit.

How far have you gotten? Have you set up your project? Your references? Can you see anything from EA in your code?

David
No, you can't have it!

BioformLivesAgain

  • EA Novice
  • *
  • Posts: 12
  • Karma: +0/-0
    • View Profile
Re: New to Add-Ins... Using MS VS.Net 2005 (using
« Reply #2 on: March 10, 2008, 03:38:39 pm »
Hey Midnight!

Took me awhile to find my towel!

This is what I have done so far...

1.) I grabbed the zipfile from the website for the "CS_AddinFramework" example (it's in C#, but I figured if I could get this working, I could figure it out for VB) and extracted it... converted it to 2005 using the VS wizard and compiled it with no problems...

2.) Added the Reg key value for the Add-In "CS_AddinFramework.Main"

3.) Configured VS 2005 (Express) using the notes for VS2003...
Started debugging (F5) after setting a breakpoint in the main class...

4.) EA loads.... displays menus... but the add-in does not start running in the debug window...

IF I open the add-in manager the add-in is listed, but the status entry says ''Error-Missing"...

So SOME success, but not a lot!

Other, Other David

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: New to Add-Ins... Using MS VS.Net 2005 (using
« Reply #3 on: March 10, 2008, 04:15:19 pm »
David,

You're almost there.

1. you've created a dll -> OK
2. you told EA to load that dll as an addin (via de regkey)
3. EA tries to load the dll, and asks Windows where it is. At this point Windows does not know yet. What you have to do is register the dll in Windows using regsvr32

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: New to Add-Ins... Using MS VS.Net 2005 (using
« Reply #4 on: March 10, 2008, 09:28:14 pm »
Sounds like you've done all the right things, except to register the dll, as Geert says.

If you still have problems on the debug side, check that execution was not prevented by XP or (more likely) Vista. This is not too likely to happen, as debug sessions usually work.

Let us know!

David
No, you can't have it!

BioformLivesAgain

  • EA Novice
  • *
  • Posts: 12
  • Karma: +0/-0
    • View Profile
Re: New to Add-Ins... Using MS VS.Net 2005 (using
« Reply #5 on: March 11, 2008, 01:16:14 pm »
Thanks for the help... but I can't seem to get the DLL to register successfully?

First I was getting an error when my registration path to the DLL contained an embedded space (C:\Documents and Settings\...) I moved the project to another directory without embedded spaces and rebuilt.

Then regsvr ...pathname\{DLLName}.dll and then got this error message:

...dll was loaded, but the DLLRegisterServer entry point was not found. This file can not be registered....

I am using XP btw,

Gonna take a break and read some Vogan poetry to get over this lack of nausea...

OtherDavid

Aaron B

  • EA Administrator
  • EA User
  • *****
  • Posts: 941
  • Karma: +18/-0
    • View Profile
Re: New to Add-Ins... Using MS VS.Net 2005 (using
« Reply #6 on: March 11, 2008, 03:07:01 pm »
From memory, .NET DLL's get registered with regasm.exe, not regsvr32.exe.  In either case, you shouldn't need to manually run this to do debugging.  In your VS project, make sure that "Register for COM Interop" is enabled (I think this is usually under the Build options).

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: New to Add-Ins... Using MS VS.Net 2005 (using
« Reply #7 on: March 11, 2008, 11:03:34 pm »
Thanks Aaron,

If I actually had a memory, this might have jogged it.

The obvious - meaning 'usually overlooked by Midnight' - step is to make sure you set your project to be visible to COM. You generally do this when you create the project, by choosing an appropriate project template. You can also open the Assembly Information dialog from My Project Application page and check the option at the very bottom of the dialog.

Now the rest starts to work, just as Aaron says.

David

PS: Make sure that Visual Studio knows you want to debug with EA. In VS, open the My Project Debug page. You'll see an option called Start Action. Choose the middle option, Start external program. Set this to point to EA. After all, your add-in won't be much use without EA running, will it?
No, you can't have it!

PaulH

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: New to Add-Ins... Using MS VS.Net 2005 (using
« Reply #8 on: March 12, 2008, 12:21:53 am »
One point, you mention "configured VS 2005 (Express)" did you mean the Express edition of VS 2005?

If so, it doesn't support add-ins by design.

Regards

Paul

bioform

  • EA User
  • **
  • Posts: 230
  • Karma: +0/-0
  • Forty-Two?
    • View Profile
Still Having a problem... VS2005(Std) Add-In Error
« Reply #9 on: December 30, 2008, 05:03:35 am »
Okay, sorry about the LONG delay in posting a response... just about a year!

I was once again having a problem getting the CS_AddinFramework to run in debug without getting the "Error - Missing" message in EA. Somehow last Friday it started working... I did not "change" anything that I know of... e.g. no EA.exe.config added, no registration of DLL, etc.

Now I have converted the CS example to VB, got it to build correctly (using .Net 2.0.0.0 references), and start debug and get the SAME error message?!!

I have tried adding the EA.exe.config file with the ref. to 2.0.0.0 to no avail... also tried 2.0.0 also...

ANYONE.. PLEASE... I am sitting here gnashing my towel!! HELP!!!

Thanks, and I hope everyone is having a great holiday season..

David
Time is what keeps everything from happening at once, Space is what keeps it all from happening to you. <unknown>