vb.netcatia

Multiple API version


I have a visualbasic application that interacts with several versions of software (Catia) The Visual basic code is common to all versions of Catia software but it only works if the dlls of the correct version are referenced. Is it possible to reference the dlls of all Catia software versions in the app (they have the same name) and to use the correct dlls after having detected the software version.


Solution

  • I understand that you have a compiled .exe referencing the catia-api. I encountered the same problems with our applications. Two solutions that worked for me:

    1. compile separate .exes for each catia release you require. Means: have one catia release running, then compile. Repeat with next release. The -regserver should be done by Catia when starting (which I am not 100% sure about, you might still need to do the -regserver as C R Johnson explained).

    2. Use LateBinding which means do not reference any catia-dll/tlb at all. Instead use reflection to call api-methods. This is a lot more effort when developing your app, because you cannot use IntelliSense. (As a workaround you could develop with EarlyBinding in only one Catia release. When finished, change your code to LateBinding getting rid of all catia-api-references.)