Reputation: 21220
Have both versions of visual studio installed on a machine. I am wondering if the lower version of visual studio can use the dll built using higher version of visual studio?
Upvotes: 2
Views: 475
Reputation: 147036
Only if you restrict yourself to what's called a C-style interface- only primitive types, the code that allocates any resource must deallocate it, and also must abstract over non-memory resources like file handles, etc. You cannot send C++ classes or objects or deallocate memory across DLL boundaries except under some extremely strict conditions.
Upvotes: 1
Reputation: 3058
In general, you cannot mix dlls compiled with different versions of the CRT in one program. Here's a link to the documentation at MSDN.
As others mentioned, it works if you keep the interface simple. Don't free memory allocated with one CRT in a DLL linked to another version of the CRT, don't pass FILE* and similar around. Unfortunately, it's hard to know for sure what you can do and what you can't do.
Upvotes: 3
Reputation: 811
It depends on the DLL. For example, if you create a Win32 DLL, using simple parameter types and the same calling convention, it works.
Upvotes: 1