| |

VerySource

 Forgot password?
 Register
Search
Author: 达摩克斯

I have been thinking about the problem for a few days, please come and see, I am anxious!!

[Copy link]

0

Threads

6

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 China

Post time: 2020-9-27 14:00:01
| Show all posts
1. It is possible to pass the object pointer
2. But cannot call functions related to handle mapping. For example, CWnd::GetDlgItem(). As long as it does not cause the following function to be related to other handle mapping functions, it is fine.

CWnd* PASCAL CWnd::FromHandle(HWND hWnd)
{
CHandleMap* pMap = afxMapHWND(TRUE); //create map if not exist
ASSERT(pMap != NULL);
CWnd* pWnd = (CWnd*)pMap->FromHandle(hWnd);

#ifndef _AFX_NO_OCC_SUPPORT
pWnd->AttachControlSite(pMap);
#endif

ASSERT(pWnd == NULL || pWnd->m_hWnd == hWnd);
return pWnd;
}
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list