c# - DllImport Based on OS Platform -
I have a mix of unmanaged code (backend) and managed code (front end), like I need to call the interop Unmanaged code from my managed code using techniques and DllImport
attribute
Now, I have compiled two versions of unmanaged code for both 32 and 64 bit OSes; They are named as And call on what basis my app is running. The issue is now that for each unmanaged function I have to declare it twice, this is a duplication of work for a 32 bit OS and a 64 bit OS, and all the time I have an unmanaged function Changing the signature, I have modified it in two places. Anyway, can I change the argument in the service32.dll
and service64.dll
respectively. Therefore, in my net code, I will have to do DllImport
for both delays: 32 bit for DllImport
so that the correct DLL on the basis of the platform is automatically applied?
I do not think that supports DllImport, you just manually call LoadLibrary etc. You can.
But take a look, the answer will be similar to yours.
Comments
Post a Comment