Building Applications From Scratch

<< Click to Display Table of Contents >>

Navigation:  Programming with Common Vision Blox > Multi-Platform > Portable Code >

Building Applications From Scratch

 

C++

When starting a new application, using the newly introduced type system in the DLL interface is recommendable as this will make ports to other platforms a lot easier.

When using ActiveX controls, do not forget to replace the faulty C++ wrappers generated by Visual Studio with the ones provided in %CVB%\Wow6432\Visual C++ OCX Wrappers.

 

In case you are planning on targeting Linux later on it is a good idea to either use a GUI toolkit that is available for both platforms right from the beginning or to keep your user interface code as separate from your image processing code as possible to make the necessary switch to a different GUI toolkit easier.

ActiveX controls are a technology that is not available on the Lin64 platform and should therefore not be used at all in applications that are intended to be portable.

Note that for C++/CLI projects in Visual Studio 2010 the AnyCPU tweak for aximp and tlbimp described in the migration section must also be applied.

 

.Net

With newly created .Net applications there is actually not much attention to be paid to Win32/Win64 portability.

The main issue here is to keep track of which platform the ActiveX wrappers have been created on (if your application uses ActiveX controls); a mismatch however will immediately lead to an exception, is therefore fairly easy to identify and will probably never go unnoticed.

Keeping the coding hints from earlier in mind and using the new shared objects will help avoid improper reference count handling and (for VB.Net users) perilous assignments of 64 bit values to 32 bit variables.

If you use Visual Studio 2010 please note that the AnyCPU tweak described in the migration section must be applied to a project file before it will be possible to generate and run applications targeted to the .Net 4.0 framework.