Hi,
I'm looking for an answer to this problem, I have a functions in dllexport library like this:
Code:
struct ST1 //define global outsize class;
{
///...int,bool,..
CString abc = L"";
int a = 1; //
int b = 1; //
int c=-410;
int d=-410;
};
class dllexport myclass{
public:
void myfunction(bool mycase, vector<vector<ST1>>&); //can't initialize this vector.
}
//cpp
void myclass::myfunction(bool mycase, vector<vector<ST1>>& vec){
for(int i=1;...)
{
vector<ST1> vec1;
for(int j=1;..)
vec1.pushback(ST1{..,..,..}); //ok
}
vec.pushback(vec1);// <-- error at this code
}
}
in myproject, I call myfunction by this code:
Code:
vector<vector<ST1>> vec;
myclass* cls;
//..initialize cls
cls->myfunction(true, vec); //error bad array.. at vec.pushback(vec1)
now, I get these error:
Note: this code runs fine if i use vector<vector<struct>> directly in myproject, but error occurs only after i use it through parameter in function from exportlibrary.
How i can fix this error?
Thanks you!