网上找的mfc web,但是这里跑出错,试了多种初始化还是不行,求大佬帮助
啊这,你这代码bstrTitle是BSTR类型的指针,你不初始化当然要报错啦。
一下提供两种方法,你一种一种试试把
//1.第一种初始化为空指针,大概率后续程序会报错,或返回错误值
BSTR* bstrTitle = nullptr;
pDoc->get_title(bstrTitle);
//2.第二种开辟内存,我猜测 get_title 会填充这个内存
BSTR* bstrTitle = (BSTR*)malloc(sizeof(bstrTitle));
memset(bstrTitle, 0, sizeof(bstrTitle));
pDoc->get_title(bstrTitle);