I have an array of strings like this:
using std::string;
string myArray[] = { string("abc"), string("foo"), string("muh") };
Now I want to use this function:
HRESULT Init(T* begin, T* end, IUnknown* pUnk, CComEnumFlags flags = AtlFlagNoCopy );
T is in my case LPOLESTR. So I need to convert the array of std::string to LPOLESTR respectively I need an LPOLESTR* to begin and end of this array. How is that done?
Thx in advance
ATL has a set of macros for string conversions. In your case, you can use:
Note that OLESTR is basically a wchar_t*, so if you’re using std::wstring (or wide char string literals) you don’t even need the macro: