【发布时间】:2012-11-06 11:03:00
【问题描述】:
LPCWSTR location_url;
m_spWebBrowser->get_LocationURL((BSTR*)&location_url);
如何比较 LPCWSTR 和 const char * 中的 strstr ?
例子:
if(strstr((location_url, ".html"))
【问题讨论】:
-
get_LocationURL()返回实际的BSTR,而不是LPWSTR。您需要修复变量声明。并且不要忘记在使用完毕后调用SysFreeString(),否则会出现内存泄漏。
标签: c++ c winapi visual-c++