How about using ActiveX-controls in 64-bit zenon?

64-bitIn some projects ActiveX-controls are used for custom GUI objects rather than creating them from standard zenon screen elements. Usually these ActiveX-controls are written in VB6 or C++. All these ActiveX-controls are 32-bit components and cannot be used in 64-bit applications out of the box. But under some circumstances it takes only some simple modifications to make them run in 64-bit aswell.

Background

ActiveX-controls in principle are DLLs with a standardized COM interface. So they are in-process COM-servers and are loaded directly into the host application process. Now, fact is that generally a 64-bit application is only able to load 64-bit DLLs. So 32-bit ActiveX-controls cannot be loaded by 64-bit zenon. To make this possible, the 32-bit ActiveX-control must be ported and compiled into a 64-bit DLL.

Bad news

Unfortunately the previous VB6 is not able to generate 64-bit output. So there is no way of bringing a VB6 ActiveX-control into 64-bit zenon except by rewriting it completely in C++ e.g. If it is absolutely necessary to keep them, one must stick to 32-bit zenon even if the used platform would offer using the 64-bit version. The same is true of course, if you do not have the source code at all and only have the 32-bit binaries.

Good news

If your ActiveX is written in C++ and you have the source code, you can easily introduce a second x64 configuration into the project and compile a 64-bit AcitveX-control then. Usually there are no or only minor changes necessary in your source code that make it run again in 64-bit. And please don’t forget to also register 64-bit ActiveX with regsvr32 afterwards. 32-bit and 64-bit ActiveX-controls are registerd in different registry paths, even if they have “the same control” with the same CLSID and name.

Tags: , ,

Leave a Reply