Share via

Why does CWnd::GetSafeOwner return null ?

Suzuki Masato 1 Reputation point
2022-07-07T05:26:34.61+00:00

OS:Windows 10 Pro 21H2 19044.1766
Browser:Edge 103.0.1264.44 Use IE Mode
Application: ActiveX (C++/MFC OCX 32bit)
Visual Studio 2019

Problem
①Launch browser. Show web page(page1).
②Click Button of page1.(Using window.open API of JavaScript)
③Show another web page(page2).(Page containing ActiveX)
④CWnd::GetSafeOwner called inside ActiveX returns a valid window handle.
⑤Then close the web page(page2).(Using window.close API of JavaScript)
⑥Click Button of page1 again.(Using window.open API of JavaScript)(Show web page2 again).
⑦This time CWnd::GetSafeOwner called inside ActiveX returns null.

I want to know why CWnd::GetSafeOwner returns null for the second time.

Developer technologies | C++
Developer technologies | C++

A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.