且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何获取网页窗口句柄

更新时间:2022-10-30 11:18:04

您是否构建了一个Web应用程序?如果是这样,那么您将无法使用C ++ DLL来获取Web浏览器窗口。 Web浏览器位于客户端上,您的所有代码都在服务器上运行。唯一可以访问Web浏览器的代码是客户端
端JavaScript代码。 JavaScript不能调用您的C ++ DLL,也不能调用除JavaScript以外的任何其他内容(如果您碰巧在较旧的IE版本上运行且网络团队未禁用支持,则可能使用ActiveX)。


有关Web开发的问题,请在ASP.NET
论坛
上发布。


Michael Taylor

http://www.michaeltaylorp3.net


Hi,

In my project there is a C++ dll that deals with windows handle. It was typically written to be used with Old Gupta Sql windows application. Now we will have to reuse the same dll in .net web application. we could able to call all the methods of the C++ dll from C# code through interop and mershalling. But now the question is how to pass the windows handle parameter from the web application. If we use web form application how to pass the current web page handle to the C++ dll method ? Please help!!

Thanks,

Prabhat Ghosh.

Are you build a web app? If so then you aren't going to be able to use a C++ DLL to get the web browser window. The web browser is on the client, all your code is running on the server. The only code that has access to the web browser is the client side JavaScript code. JavaScript cannot call your C++ DLL nor anything other than JavaScript (and maybe ActiveX if you happen to be running on an older IE version and the network team hasn't disabled support).

For further questions related to web development please post in the ASP.NET forums.

Michael Taylor
http://www.michaeltaylorp3.net