到ATL的静态链路总是失败
Static link to ATL always fails
我使用一些ATL函数来创建媒体控件,但似乎我只能使用动态链接到ATL选项。当我切换到静态链接到ATL时,我就是不能成功创建控件。
我很困惑。有人能帮我吗?
下面是我的代码://related headers
#include <wmp.h>
#include <atlbase.h>
#include <atlcom.h>
#include <atlhost.h>
#include <atlctl.h>
//related vars
CAxWindow m_wndView; // ActiveX host window class. CComPtr<IWMPPlayer>
m_spWMPPlayer; // Smart pointer to IWMPPlayer interface.
//related function code:
CComPtr<IAxWinHostWindow> spHost;
HRESULT hr;
m_wndView.Create(m_hWnd, rect, NULL, WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN, WS_EX_CLIENTEDGE);
hr = m_wndView.QueryHost(&spHost);
/*
when I switch to "Static Link to ATL" option, I will fail here
E_FAIL == hr;//the failure flag
*/
if(!SUCCEEDED(hr)) return FALSE;
hr = spHost->CreateControl(CComBSTR(_T("{6BF52A52-394A-11d3-B153-00C04F79FAA6}")), m_wndView, 0);
if(!SUCCEEDED(hr)) return FALSE;
hr = m_wndView.QueryControl(&m_spWMPPlayer);
if(!SUCCEEDED(hr)) return FALSE;
当静态链接到ATL时,您必须使用预处理器:_ATL_DLL,
Property Pages | C/c++ | Preprocessor相关文章:
- vscode g++链路故障:体系结构x86_64的未定义符号
- GLFW DDS 加载函数的 OpenGL 链路错误
- QBS 为静态链路 MSVC 创建静态库
- VS 链路错误描述中的"@@YAHXZ"是什么意思?
- 数据结构:多(A)对多(B)关系,每个链路也有自己的数据(C)
- 在 OpenGL 计划链路状态检查期间"No definition of main in vertex shader"
- 提升单元测试链路错误
- C++ shared_ptr基于单调导致链路错误的原因
- 为什么Typedef结构会产生链路故障
- 链路寄存器 (LR) 是否受内联函数或裸函数的影响
- 如何查找 IP 地址是否为链路本地地址
- C 程序检测物理链路状态和数据包丢失
- 如何处理系统链路控制的NM_CLICK
- MPG123 链路错误"_read"和"_lseek"
- 在VS2012中使用时出现log4cplus链路错误
- C、 所有平台中进程的C++CPU使用率和内存使用率+当前时间的可用网络下行链路带宽
- Parasoft c++测试链路单元测试错误
- 在ns3中的两个节点之间创建无线链路
- 设置链路顺序和LINK_INTERFACE_MULTIPLICITY
- 到ATL的静态链路总是失败