More are more developers are migrating their add-in to registry-free. There is a post on the migration of .NET add-in: Migrate .Net Add-Ins to registry free. The basic steps are similar with C++ add-in. In this post, we will highlight some details which are C++ specific.
Assume you have a project created by the previous wizard.
– DllRegistryServer
– DllUnregistryServer
- remove post-build events for registry.
- make sure to enable “embed manifest”.
- On some machine, it will need to disable UAC with the project.
- Add manifest file and *.addin to the project. Here the template file for the two files are attached. Please firstly change the file name with your project name if you want to use them.
Download Autodesk.CPPSampleTest.Inventor
- add the manifest file to the project
- Edit the manifest content according to the project information. Note: the format of manifest of C++ add-in is NOT same to .NET add-in. With the template above, you will need to update:
- name: the project name
– file name: the result dll name
- clsid: this can be found at *.idl file of the project
- tlbid: this can be found at *.idl file of the project
After modification, the manifest becomes:
- edit the *.addin file with the corresponding information.
-ClassId
-ClientId
-DisplayName
-Assembly: absolute or relative path to indicate where the dll locates in
– others options you want to change
- Build the project to see if there is any error. Next, copy the *.addin file to the specific path which Inventor will load add-in there. In this post, we put it to the %AppData%\Autodesk\ApplicationPlugins.
You can also add a script in post-build event to copy the *.addin file and *.dll to the specific path (if the *.addin file specifies to load the *.dll with relative path).
- Now launch Inventor, it should load the add-in.
12.Known issues
1) remind again that the format of manifest of C++ is not same to .NET
2) The newest add-in wizard will create registry-free add-in. If you speficied the RDS name, the result *.dll will contain the name. But the manifest file ignores RDS string. So please make sure the two are consistent.
3) In default, the add-in wizard will create the add-in using IDispatch interfaces. BUT such registry-free add-in cannot work on XP OS (no matter 32bit or 64bit). The add-in can be seen in Inventor, but it is not loaded. In addition, it will throw exception when debugging it. The workaround is to use Vtable interfaces. So if you have an existing add-in which uses IDispatch interfaces, you need to convert it to use Vtable interfaces for XP OS.



















Leave a Reply