在Windows Phone 8.1 Silverlight应用程序中使用wininet.dll [英] Using wininet.dll in Windows Phone 8.1 Silverlight app
问题描述
我希望通过调用wininet.dll上的方法在我的Windows手机应用程序进程中设置代理。我使用P / Invoke在WinRT应用程序中实现了这一点。由于P / Invoke在WP8.1 silverlight应用程序中不起作用,经过一些搜索后我想出了这样做的方法是创建一个
的Windows Phone Runtime C ++组件并将调用包含在其中的wininet.dll中。我无法弄清楚的是如何在运行时组件中包装对wininet.dll的调用。尝试在WPRT组件中引用dll时,由于以下原因之一,无法添加
引用:-Targets更高版本的.Net。 - 不是.Net程序集。 - 没有注册的ActiveX控件。"。
我该怎么做?任何帮助将不胜感激。
Windows Phone应用程序无法直接调用本机系统库,需要通过调用代理 这个可调用的Win32 API列表及其相关的调用代理dll在这里:
http://msdn.microsoft.com/en-us/library/windows/apps/jj662956(v=vs.105).aspx
I am looking to set proxy on my windows phone app process by invoking methods on wininet.dll. I achieve this in WinRT app using P/Invoke. Since P/Invoke does not work in WP8.1 silverlight app, after some search I figured out way to do this is to create a Windows Phone Runtime C++ component and wrap calls to wininet.dll inside it. What I am unable to figure out is how do I wrap calls to wininet.dll in the runtime component. Trying to reference dll in the WPRT component fails saying "Could not add reference due to one of following reasons : -Targets higher version of .Net. -Not a .Net assembly. -Not a registered ActiveX control.".
How do i do this? Any help will be greatly appreciated.
A Windows Phone app cannot directly call native system libraries, it needs to go through a call proxy. This list of callable Win32 APIs and their associated call proxy dll is here: http://msdn.microsoft.com/en-us/library/windows/apps/jj662956(v=vs.105).aspx
这篇关于在Windows Phone 8.1 Silverlight应用程序中使用wininet.dll的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!