64 bit accessing 32 bit application error

 

Mixing 32 bit with 64 bit it is not allowed – see https://support.microsoft.com/en-us/kb/282423 .

However, there are several solutions to accesing 32 bit from 64 bit :

1. Simpler – create a console exe (32 bit) application that calls the library ( same bit version) . Use this from the main program.

Cons: Error handling , difficulty to debug

2. Complicated :Read this and make your solution https://blog.mattmags.com/2007/06/30/accessing-32-bit-dlls-from-64-bit-code/

3.Use a NUGET package to call 32 bit from 64 bit.

See https://github.com/CodefoundryDE/LegacyWrapper and details here: https://blog.codefoundry.de/programming/legacy-wrapper-invoking-an-unmanaged-32bit-library-out-of-a-64bit-process/