问题描述
以allah的名义
玩得开心
i使用visual c ++ 2012。
如何在ActiveX项目中从CDC获得CWnd?
谢谢
我的尝试:
我试过吼叫代码但不起作用。
void CLanxXCtrl :: OnDraw(
CDC * pdc,const CRect& rcBounds,const CRect& rcInvalid )
{
HWND h = WindowFromDC(pdc-> m_hDC);
CWnd * w = CWnd :: FromHandle(h);
...
}
这个CWnd会起作用但Project中的ActiveX不可见,OnDraw功能在运行时不起作用。
我该怎么做?
in the name of allah
have a good time
i work with visual c++ 2012.
how can i get the "CWnd" from a "CDC" in an ActiveX project?
thanks
What I have tried:
i've tried bellow code but doesn't work.
void CLanxXCtrl::OnDraw(
CDC* pdc, const CRect& rcBounds, const CRect& rcInvalid)
{
HWND h=WindowFromDC(pdc->m_hDC);
CWnd *w=CWnd::FromHandle(h);
...
}
this CWnd will work but cause of the ActiveX in Project is not visible, the OnDraw function doesn't work in run time.
how can i do that?
推荐答案
这篇关于我如何从cdc获得cwnd?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!