VS2017环境,调用 OleInitialize(0),出现了未定义标识符。
请问,要C++要使用微软接口,工程属性要怎么配置呢?
HRESULT r = OleInitialize(0);
if (r != S_OK && r != S_FALSE)
{
qWarning("Qt: Could not initialize OLE (error %x)\n", (unsigned int)r);
}
添加如下头文件试试:
#include <winx.h>
#include <ole2.h>