Recently, I am working in extracting cab file with CabExtract(written in C) in 64 bit C# application
. The library works fine when it is run in 32 bit application but when same library used in 64 bit application, it throws following exception:
The importing from cabExtract.dll has been implemented in following way:
[DllImport("cabExtract.dll", EntryPoint="ExtractCabBegin", CharSet=CharSet.Unicode, ExactSpelling=true)]
internal static extern int ExtractCabBegin();
Exception : System.BadImageFormatException
Message :An attempt was > made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)
I suspect the CabExtract library supports for 32 bit.But I have not found any CabExtract library for 64 bit. So, my question :
Will it able to use 32 bit unmanaged library from 64 bit managed application? If yes, how can it be done?