views:

273

answers:

2

Our company is migrating its entire product line from a C++ codebase to the .NET Framework. We have a very large codebase, and this migration is being done incrementally over the course of many years.

We would like to enjoy some of the benefits of pure managed code, such as Silverlight, but there are many legacy C++/x86 modules that will take time for us to port to .NET.

One solution would be for us to load these modules into a lightweight x86 emulator running in a small memory sandbox in the .NET Framework. This would allow us to call into legacy x86 DLL code while maintaining a pure managed application.

Does anyone know of such a project?

Sincerely,

Dan

+2  A: 

I don't know of a project that would allow this.

That being said, I don't think this is a realistic expectation in any case. Using native code isn't just about being able to run x86 instructions.

The larger issue will be about utilization of library code. This isn't going to be portable into an emulator, since the emulator would probably not just need to implement x86 instructions, but also simulate the Windows API, etc.

If the native code is just pure numeric code, porting it is probably easier than testing it under an emulator. If it's complex code using libraries, I don't see this working practically, even if such an emulator existed.

I would just focus on the functionality you need to truly be purely managed, and try to get it migrated. C++/CLI makes this simpler (provided your native code was in C++), since you can always try compiling one file at a time with /clr:pure enabled, and just fix errors as needed.

For things that don't require 100% managed, the interop in C++/CLI is a good stepping stone until you can port your code base across.

Reed Copsey
A: 

Change for Java instead of .net. Then you can use this:

http://jpc.sourceforge.net

to run existing code

or compile to Java B-code from C++ using LLJVM or something similar.

Grzegorz