我正致力于在Win32应用程序中实现oauth。我可以在我的应用程序中托管web浏览器控件,并且可以使用IWebBrowser2接口导航到指定的oauth链接。
登录成功后,服务器以包含我需要的授权令牌的json文档的形式发送响应。
我见过C#/WPF示例,其中客户端代码在WebBrower.DocumentCompleted事件中捕获令牌。
我想知道如何在我的C++应用程序中到达文档完成的事件。我现在只有IWebBrowser2对象。致以问候。
发布于 2014-09-16 03:13:22
( 1) WebBrowser2.QueryInterface(IConnectionPointContainer,ConnectionPointContainer)
2) ConnectionPointContainer.FindConnectionPoint(DIID_DWebBrowserEvents2,ConnectionPoint)
3) ConnectionPoint.Advise(Self,ConnectionPointCookie)
4)自身必须实现IDispatch
5)在Self.Invoke内部,您将捕获包括DISPID_DOCUMENTCOMPLETE在内的所有事件。
别忘了在工作结束时给ConnectionPoint.Unadvise打电话。
https://stackoverflow.com/questions/25858134
复制相似问题