I have a function that works with std::vector, declared like this:
void MyFunc(std::vector<std::wstring> &vFillArray){
//....
//fill the vector with wstrings
//....
}
Now I would like to export my function in a DLL library and make it available to a vb 6 application. Using the library as it is, would crash the vb 6 application. I have to change the declaration to LPWSTR** (or wchar_t** I think) but now, how to reconvert this type internally in my c++ function? Internally I use std::vector to fill the vector with string. Any advice?
Assuming
LPWSTR
is the same aswchar_t
, you can use the usual iterator-assignment constructors and functions ofstd::vector
: