user705414
user705414

Reputation: 21220

Wondering if the lower version of visual studio can use the dll built using higher version of visual studio?

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

Answers (3)

Puppy
Puppy

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

user52875
user52875

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

Juliano
Juliano

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

Related Questions