4 hours ago, SteveRichter wrote
*snip*
That is interesting. The 32 bit DLL that I had trouble with in C++ was useable from C# thru P/Invoke. Another C++ annoyance is the .LIB file requirement. To link in C++ you need the .LIB file. And to run, the .DLL. With C# P/Invoke, only the .DLL is necessary.
The thing you need to be careful with in that case it what CPU you're C# assembly is set to. Since your .dll is obviously 32-bit, it will appear to work fine if the C# is set to AnyCPU and you test on a 32-bit system. If you subsequently move to a 64-bit machine, it'll suddenly break. However if you explicitly set the CPU to 32-bit in the project, it'll always work (though obviously won't take full advantage of a 64-bit CPU).
IIRC the default CPU type in Visual Studio changed around VS2010 from AnyCPU to 32-bit, precisely because people weren't realising this.