tags:

views:

853

answers:

1

Hi,

I am working on an application that has more than a few dlls written in VB6. VB6 code includes COM dlls and ocx controls. The rest of the code is in C++ and C#. I have been assigned the task to make the application code base compatible with 64bit architectures. Loads of help material is available for C/C++ code so thats not a problem at hand. But it isn't easy to rewrite all of this vb6 code into .net or some other language to make it compatible with 64bit. Neither do I understand all the underlying logic so just assume that rewrite is out of question.

On the other we all know that VB6 dlls wont work in 64bit environment. So what are my options.

1) covert each of the dll into an EXE which will be loaded in 32bit and it can interact with my rest of 64bit application via COM interfaces. Do you foresee any problems with this approach?

2) I edit the registry and load all the VB6 dlls out of process, make them load in dllhost.

3) Make a single 32bit exe, refer all of these VB6 dlls in that exe and load that exe in 32bit address space and the 64bit part of my application communicates with the 32bit exe.

The major problem that comes to my mind with all of the above mentioned approaches is what to do with OCX controls????

Any ideas? If no new ideas than which of the above mentioned will be preferred by you and why?

A: 

If you have lots of existing VB6 code that uses to run in-process, I'd first question if migrating to 64 bit is really worth the effort. 64 bit has many advantages for server apps, but for desktop apps, 32 bit is often completely sufficient. And as WOW64 can be expected to be available for at least a decade, there is little speaking against running 32 bit apps on 64 bit Windows.

The point is, although it is possible that by using out-or-process servers you could tweak your app so that it runs at least partially in 64 bit mode, this will probably have a significant impact on performance (and also on memory overhead). Odds are that the customer therefore has absolutely no benefit from choosing the 64-bit version of your app.

That said, I'd say 2) or 3) would be the natural choice. 2) is certainly easier to implement, but 3) gives you more control of how many out-or-process servers should be created and how their lifetime is managed.

Johannes Passing
I understand all your concerns :( but the problem is that my application runs as an add-in in AutoCAD. And AutoDesk requires you to buy 64bit version of AutoCAD if you want to run AutoCAD on 64bit windows. AutoCAD installer wont allow you to install AutoCAD in WoW mode on a 64 bit windows. So my application has to run in 64bit mode. Its not a matter of choice for me. I have no other choice but to provide a 64bit version of my application for those customers who have installed 64bit windows.
Paragon
I see. I think an important aspect to consider before making a decision is to assess how much communication would have to take place between the AutoCad process and a (32 bit) OOP-server. For objects that are used very frequently, I'd seriously consider reimplementing them in C++ or whatever language s.t. they can be hosted in the 64 bit process. For not-so-frequently used objects, an out-of-process solution may be adequate. I think without such consideration, it is hard to judge whether the out-of-process strategy really is feasible.
Johannes Passing
No easy way out. We have decided to rewrite our code.
Paragon