How to deal with such situation?(Need pass STL vector to dll under vs2008) [modified]
-
I have a COM dll, the dll expose a method BOOL Open(const wchar_t* filename, OUT std::vector<MyStruct>& dataout); The function 'Open' take the parameter filename, to open the file, and construct the data from the file to pass it out to outside world. But of course the client crash in runtime because the CRT problem, I googled and the link give me answer, http://social.msdn.microsoft.com/Forums/en-US/vclanguage/thread/83a026d8-09b1-4d57-8c4a-ab2d139624b4[^] So if I don't want pass STL vector as out parameter, then How can I design my COM dll to deal with such situation(open read the file and pass out the data)?
modified on Tuesday, August 24, 2010 2:02 AM
-
I have a COM dll, the dll expose a method BOOL Open(const wchar_t* filename, OUT std::vector<MyStruct>& dataout); The function 'Open' take the parameter filename, to open the file, and construct the data from the file to pass it out to outside world. But of course the client crash in runtime because the CRT problem, I googled and the link give me answer, http://social.msdn.microsoft.com/Forums/en-US/vclanguage/thread/83a026d8-09b1-4d57-8c4a-ab2d139624b4[^] So if I don't want pass STL vector as out parameter, then How can I design my COM dll to deal with such situation(open read the file and pass out the data)?
modified on Tuesday, August 24, 2010 2:02 AM
You can check if a safe array helps instead of vector.