Is it possible to force a .NET dll running in a 32 bit process to 'act' like a 64 bit process?

377 Views Asked by At

I am almost sure this isn't possible but it's worth an ask...

We have a .NET DLL that is being called from our VB6 application. The VB6 app runs in a 32 bit process so the DLL runs in the same process (it's compiled as any cpu) Therefore when I do my ODBC Database access in the DLL is will only use a 32 bit driver, as this is what it thinks it needs (for the record the DB is Pervasive PSQL)

My problem arises when the application runs on a 64 bit machine (when only the 64 bit ODBC driver is installed) as it can't find a suitable driver to use.

So is there a way to force the .NET DLL to run in a 64 bit process (compiling as x64 doesn't work because register for COM Interop is not allowed)

This isn't necessarily an issue at this point in time because I can install the 32 bit driver, but at some point in the future I can imagine that 32 bit driver may not be available so I will be up the proverbial creek.

1

There are 1 best solutions below

1
On BEST ANSWER

No there's no way for any 32 bit process to behave as if it were a 64 bit one. The best way I can think of to accomplish this is to use 2 process's.

  1. The VB6 application which is running in 32 bit mode and loading your DLL
  2. A 64 bit process which actually accesses the driver.

It's possible to communicate between 32 and 64 bit processes using a number of different options: WCF comes to mind here.