VS.NET 2005 AddIn Demo

 

I get asked quite often for updated VS.NET 2005 project templates but usually don't have a very good answer or at least not the answer that you want to hear.  I decided to put together my best solution and make it available as a demonstration of how I would write a .NET addin if I needed to.

Attached to this post is a single .zip that contains 1 solution and 3 projects.SEAddInShim - This is the core Solid Edge AddIn.  It gets loaded by Solid Edge and it in turn loads the configured .NET AddIn.  You will need to update the project settings to point to your specific installation of Solid Edge.  There are .pdf's in the documentation folder showing the settings.  This project also must be set as the startup project.  You'll also want to change the Debugger Type option to "Mixed".  You can then debug the C++ & .NET source at the same time.  Very cool!SEAddInVB - A VB.NET Solid Edge AddIn that gets loaded by the shim.SEAddInCS - A C# Solid Edge AddIn that gets loaded by the shim.

There is a documentation folder that contains misc .pdf's with limited documentation at this point.  While it is limited, you still need to read what I've made available because I documented what I felt were the most important points.

Once I get back from vacation, I will begin the process of converting the projects into VS.NET 2005 project templates so that you can easily build your own.  That said, I have strong disclaimers in the code to not use the provided code for production.  The reason is that you really need templates that will build you your own unique addin.  So unless you really know what you're doing, don't try and release this code to a customer.

Feedback is encouraged as it will be used when I create the VS.NET 2005 project templates.

Enjoy

 

Posted by: Jason Newell
Post date: 12/21/2007 4:40:37 PM

10 REPLIES

RE: VS.NET 2005 AddIn Demo

Hi Jason,

Thanks for the templates and your effort.

Really it worked great.

 

When I ran this prgm in my Office system, it worked great.

But i my laptop it is not working.

 

When I did rebuild program, I get the following errors.

 

"object reference not set to an instance of an object".

and this error comes in Addin.Vb -> OnConnectToEnvironment -> Catch Ex As Exception -> Messagebox.Show(ex.message)

 

What may be wrong?

 

FYI OS of both the systems is XP SP2

 

We will get more informations, when I modify this prgm according to my requiremenet.

 

Thanks

Jaya

 

Posted by: jaya priyan
Post date: 12/23/2007 3:50:45 PM

RE: VS.NET 2005 AddIn Demo

the exact problrm comes in

 

Addin.Vb -> OnConnectToEnvironment -> calling function "SetAddinInfo" (Which is in AddinBase) -> m_addin.SetAddInInfo

 

Here the program skips and goes to Catch ex As Exception

 

Any solution?

 

Posted by: jaya priyan
Post date: 1/1/2008 10:25:01 PM

RE: VS.NET 2005 AddIn Demo

Jaya,

 

That is a bug that was introdcued in .NET 2.0 that is fixed in a service pack. There is a workaround but I don't have an example handy at the moment.

 

I'll repeat my warning, do not use my demo for production unless you know what you're doing. From your comments, I suspect that's what you're planning.

 

Posted by: Jason Newell
Post date: 1/2/2008 7:04:53 PM

RE: VS.NET 2005 AddIn Demo

Thanks for the reply Jason.

 

I will update the service pack and then reply to you.

 

Already I said that, I am going to build a menu for our office purpose (Also for improving my knowledge). Since I am going to use your templates, only for building menus. (Actual functions are available as macros). So I will just invoke the Macros from the menu I am going to build.

 

 

Thanks

Jaya

 

 

Posted by: jaya priyan
Post date: 1/2/2008 7:25:43 PM

RE: VS.NET 2005 AddIn Demo

 

Feed Back

I built one addin using the VB.Net templates. and it works fine.

Then I Made more addin using the templates. After calling this into Solidedge. I found some conflicts.

The second addin does not get loaded. Image of (Toobarimage) 2nd addin appears in 1st addin.

 

I wonder why it happens.

 

Thanks

Jaya

 

Posted by: jaya priyan
Post date: 1/16/2008 9:30:00 PM

RE: VS.NET 2005 AddIn Demo

Jaya,

 

The example that I released was not a template. It was a demo and that is why I put so many warnings in the code about not trying to use the demo for anything other than a demo. There are things that you have to change to make the addin unique and unless you know where to change everything, you'll run into issues like you're seeing. Until I get the demo into VS.NET templates, most efforts like your will be futile.

 

Posted by: Jason Newell
Post date: 1/17/2008 2:53:09 AM

RE: VS.NET 2005 AddIn Demo

 

I understand jason. Once you make the template, I will start to build my company's menu. Till then I will do some more tests. and send the feedback to you.

 

Thanks

Jaya

 

Posted by: jaya priyan
Post date: 1/17/2008 6:49:20 AM

RE: VS.NET 2005 AddIn Demo

 

Jason, here is one more input to you

 

In one system MS .Net framework 2.0 is installed, where the addin is not working. Shim (C++) is getting loaded into solidedge but menu is not appearing. The problem comes in AddinBase->sub SetAddInInfo -> m_addin.SetAddInInfo(.....). Here it skips.

 

In another system MS .Net framework 2.0 is installed and updated with Security Update for MS .Net framework 2.0 (KB928365),where the addin works fine.

 

Thanks

Jaya

 

Posted by: jaya priyan
Post date: 1/17/2008 5:50:20 PM

RE: VS.NET 2005 AddIn Demo

When I did use the demo in my system (SE v18 sp0) it worked fne.

 

But after updating SE v18 sp11. the demo code is not working . It says that

 

"The version of CLR being debugged does not support debugging managed and native code at the same time"

 

 

Posted by: jaya priyan
Post date: 1/18/2008 10:21:13 PM