I have a DLL that uses a struct that is defined in a separate file, misc.h.
Code:
// misc.h
typedef struct 
{
	wstring wsvarstr;
	wstring wsvarnam;
	TNT::Matrix<double> Mf;
	vector<int> vndim;
	vector<wstring> vwsdxs;
} sTensor;
The DLL header:
Code:
#include "misc.h"


extern "C"
{
	void TAIP_API StartMyLib();
	void TAIP_API DumpTensor(sTensor st);
	void TAIP_API PrintTensor(sTensor st);
	void TAIP_API SetTensor(sTensor * st);
	int TAIP_API ReadVariableMap(wchar_t * varfilepath);
	void TAIP_API DumpVariableMap();
	int TAIP_API GetTensorVariable(wstring wsvarnam, sTensor &tensor);
	void TAIP_API ListVariables();
	void TAIP_API ListVarStrings();

}
The DLL methods utilize a class, CVarStack that also uses misc.h to define the struct sTensor.

What is remarkable to me is that this works at all, but it does. Quite nicely, in fact. Without compiler warnings,
errors, or leaks.

My understanding of DLLs is that one should not (cannot ?) pass reference objects as input parameters. In addition,
C-Linkage prohibits stl input parameters such as wstring and the presumably the stl contents of the struct.

My questions are:
1 - Why does this code work on VS 2010, VS2015 (Win 7 64-bit)?
2 - Can this code be relied upon to work on other Windows machines (Win2K, Vista, Win8, Win10) ?

Thanks for your comments.