How do i extract a substring from a variant or bstr
COM
3
Posts
3
Posters
8
Views
1
Watching
-
I use it: BSTR sMyBSTR; sMyBSTR = "Hola que onda!"; CComBSTR sCad; sCad.Append(sMyBSTR);
-
Hi, Variants store the strings as BSTRs. You can work with BSTR strings using the standard string functions if you convert it using the OLE2A(...) macro. USES_CONVERSION; char *p = strstr(OLE2A(m_bstrData), "Data="); If you have a lot of string operations I recommend you to use the WTL's CString class. It's a light weight template, which duplicate the functionality of the popular MFC's string class. Regards, Alex Gorev, Dundas Software.