Register  Login   Search
 Latest Posts Minimize

RE: Through the program to create a square tube???
Solid Edge Programming
03/10/2010 2:58 AM
fatkids

RE: .Net: print of dwg files as pdf scaling problem
Solid Edge Programming
03/09/2010 3:55 AM
wksyspro

SEpartX crashs VB6
Solid Edge Programming
03/08/2010 8:38 AM
ara

Assembly instances not supported
Solid Edge General
03/07/2010 8:10 PM
cadourian

RE: .Net: print of dwg files as pdf scaling problem
Solid Edge Programming
03/06/2010 2:44 PM
tirolerover40

RE: .Net: print of dwg files as pdf scaling problem
Solid Edge Programming
03/06/2010 4:06 AM
wksyspro

RE: .Net: print of dwg files as pdf scaling problem
Solid Edge Programming
03/05/2010 2:35 PM
tirolerover40

RE: .Net: print of dwg files as pdf scaling problem
Solid Edge Programming
03/05/2010 11:36 AM
wksyspro

How to add menu to the QuickAccessToolbar
Solid Edge Programming
03/05/2010 4:57 AM
TomasV

Save sketched profile
Solid Edge Programming
03/04/2010 9:42 AM
Autoit

Use Isotable.dll with ST2 64bits
Solid Edge Programming
03/04/2010 7:22 AM
sinex

.Net: print of dwg files as pdf scaling problem
Solid Edge Programming
03/03/2010 3:03 PM
tirolerover40

How to get the threadFeature information from CopiedPart?
Solid Edge Programming
03/01/2010 5:36 AM
Julia

RE: How to read, from a draft, the file properties of the part / assembly
Solid Edge Programming
02/26/2010 8:18 AM
mdrummond

Assy Oeration Property
Solid Edge Programming
02/26/2010 8:13 AM
mdrummond

How the expansion of the Engineering Reference?
Solid Edge Programming
02/25/2010 8:35 PM
fatkids

RE: problems with creating toolbar
Solid Edge Programming
02/25/2010 11:39 AM
Nika_Neugier

Crash editing blocklabeloccurrence value
Solid Edge Programming
02/25/2010 2:55 AM
Tymen

problems with creating toolbar
Solid Edge Programming
02/24/2010 5:43 AM
Nika_Neugier

RE: Convert .dft to .dxf
Solid Edge Programming
02/23/2010 1:11 PM
jvelasco

RE: Internal Error: Invalid Status 0x248
Solid Edge General
02/22/2010 8:46 AM
catamayo

how to get mouse click event of the view of the SEPreview.ocx
Solid Edge Programming
02/21/2010 7:29 PM
wei

how to use the SEPreview.ocx
Solid Edge Programming
02/20/2010 2:41 AM
wei

Solid Edge / Insight BOM Extraction
Solid Edge Programming
02/18/2010 9:14 AM
alspaughja

How to set FaceStyle for face in occurrence?
Solid Edge Programming
02/18/2010 1:08 AM
jurajjoob

How to set Occurrence.FaceStyle to (Use Part Style) or (None)?
Solid Edge Programming
02/17/2010 2:42 PM
jurajjoob

RE: Exception when calling....
Solid Edge Programming
02/17/2010 8:03 AM
boman

Edit occurrence in place
Solid Edge Programming
02/17/2010 5:35 AM
Tymen

Getting part surface from assembly surface
Solid Edge Programming
02/16/2010 3:18 AM
Serge

RE: Need basic CNC info please
Solid Edge General
02/16/2010 12:20 AM
jr199


  
 Forums Minimize

Subject: Register for COM interop in VB 2008 express
Prev Next
You are not authorized to post a reply.

Author Messages
danlaniganUser is Offline
New Member
New Member
Posts:4

02/01/2010 5:02 PM  

Hi,

 

I'm trying to create a SE addin using VB 2008 express edition. I am using the SE '.NET programmers guide - Chapter 12 Addins' as a reference. I don't get very far before being stumped. There is no 'Register for COM interop' in the compile tab of the project properties dialogue. I understand from some google searches that I have done that this feature is not a part of VB 2008 express. Can anyone suggest a workaround other than buying a real copy of VB 2008.

Thanks.

R.D. HollandUser is Offline
Solid Edge Developer
Site Member
Site Member
Posts:36

02/03/2010 2:22 PM  

You can run regasm.exe on your DLL. In fact, you might want to create a reg file using regasm.exe like this:

regasm.exe /regfile:myaddin.reg /codebase myaddin.dll

That will generate a .reg file. You can then double-click the file to add the data to the registry (or import it into the registry). However on a 64 bit OS, the windows explorer is 64 bit and the data will be added to the 64 bit registry hive. If edge is 64 bit, no problem. If edge is 32 bit, edge won't "see" the addin.

So I keep a regedt32.exe shortcut on my desktop (from the Windows\SysWOW64 directory) and I drag&drop the .reg file on it to get the entries added to the Wow6432Node registry hive(s).

You can also edit the .reg file and replace HKEY_CLASSES_ROOT with HKEY_CLASSES_ROOT\Wow6432Node. Then double-clicking from explorer should add the entries to the 32 bit registry hive.

You can also create a bat file that compiles and registers that you can run from the VS 2005 command prompt or explorer window. Now thanks to Microsoft, if you have the 2005 command prompt tool (ships with VS 2005 - I don't know about "express edition") the regasm.exe is available (type "where regasm" in the prompt window) in the "Visual Studio" environment. And thanks to Microsoft, if you have VS 2008, it is not! But with 2005, you can do something like this in a .bat file:

 

ECHO OFF
CLS

SETLOCAL
PUSHD %VS80COMNTOOLS%
@call vsvars32.bat
POPD

Vbc.exe /noconfig /imports:Microsoft.VisualBasic,System,System.Collections,System.Collections.Generic,System.Data,System.Diagnostics /nowarn:42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 /rootnamespace:SEAddIn /win32Resource:resTempl1.res /doc:obj\Release\SEAddIn.xml /define:"CONFIG=\"Release\",TRACE=-1,_MyType=\"Windows\",PLATFORM=\"AnyCPU\"" /reference:D:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Data.dll,D:\Windows\Microsoft.NET\Framework\v2.0.50727\System.dll,D:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Drawing.dll,D:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Windows.Forms.dll,D:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Xml.dll,obj\Release\Interop.SolidEdgeConstants.dll,obj\Release\Interop.SolidEdgeFramework.dll /debug:pdbonly /optimize+ /out:obj\Release\SEAddIn.dll /resource:obj\Release\SEAddIn.Dialog1.resources /resource:obj\Release\SEAddIn.EdgeBarForm.resources /resource:obj\Release\SEAddIn.Resources.resources /target:library *.vb "My Project\AssemblyInfo.vb" "My Project\Application.Designer.vb" "My Project\Resources.Designer.vb" "My Project\Settings.Designer.vb"

regasm.exe /codebase obj\Release\SEAddIn.dll

Vbc.exe /noconfig /win32Resource:resTempl1.res /define:"CONFIG=\"Debug\",DEBUG=-1,TRACE=-1,_MyType=\"Windows\"" /reference:D:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Data.dll,D:\Windows\Microsoft.NET\Framework\v2.0.50727\System.dll,D:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Drawing.dll,D:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Windows.Forms.dll,D:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Xml.dll /out:obj\Release\SEAddInRes.dll /target:library resproxy.vb

copy obj\Release\SEAddInRes.dll bin\Release\SEAddInRes.dll

ENDLOCAL

ECHO Compile Complete

 

Now your compile line won't be the same as the above. But no problem if "express" is like VB .NET. Just get a clean build. The output window will contain that giant "Vbc.exe" line above. Replace mine with yours in the bat file and you should be able to build from any prompt or by double clicking the bat file.

I uploaded a sample VB.NET add-in today for another post and the zip file has a number of bat files (one for each build config - x86, x64 and "Any CPU". There is also a readme.txt file that gives lots of nauseating details about how VB .NET does it's best to thwrat your every attempt to get a good addin together.

One other note, if your project doesn't have a GUID attribute, VB .NET likes to assign a new CLSID/GUID to your object each time you build. That means generating the .reg file using regasm /regfile would have to be performed each time you build the add-in. VB 6 used to have a "binary compatible" checkbox under "Component" on the properties page to keep that from occurring. I never found the equivalent in VB .NET.

danlaniganUser is Offline
New Member
New Member
Posts:4

02/04/2010 5:27 PM  

Wow, thanks.

I wasn't expecting such a well thought out and involved response, so thank you.

Given my beginner status wrt SE addins I will have to go through what you have said slowly and absord what I can. I'll also read up on the other thread that you mentioned

Dan

You are not authorized to post a reply.
Forums > Solid Edge > Programming > Register for COM interop in VB 2008 express



ActiveForums 3.7

  

 Users Online Minimize

Membership Membership:
Latest New User Latest: simoned
New Today New Today: 0
New Yesterday New Yesterday: 5
User Count Overall: 1779

People Online People Online:
Visitors Visitors: 1
Members Members: 0
Total Total: 1

Online Now Online Now:

  

Siemens PLM Connection

JasonNewell.NET on Facebook

The Code Project

Spatial Freedom Astroid

Use OpenDNS

Copyright 2008 JasonNewell.NET   Terms Of Use  Privacy Statement