是否有C#示例显示LoadPackagedLibrary的使用 [英] Is there a C# sample showing use of LoadPackagedLibrary

查看:142
本文介绍了是否有C#示例显示LoadPackagedLibrary的使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在C#项目中是否有使用LoadPackagedLibrary()的示例(任何地方)?请参阅

http:// msdn.microsoft.com/en-us/library/windows/desktop/hh447159(v=vs.85).aspx


我正在做一个DCA,需要看看我是否可以访问现有DLL中打包的功能。


我们的安装程序将此DLL安装在Windows \ System32中,那么我们可以使用LoadLibrary()吗?


或者我们应该将我们开始的C#样本转换为C ++样本吗?


我们正处于项目的探索阶段,所以我们从CameraCaptureUICS样本开始,并且是
添加一个部分,看看我们是否可以使用我们已有的DLL在我们的硬件中旋转一些位。


提前感谢快速回答!



解决方案

不,你不能使用LoadPackagedLibrary从系统目录加载DLL。在C#和C ++中也是如此 - 编程语言的选择对于这个讨论来说几乎无关紧要。 Metro风格应用程序的DLL搜索顺序(通过LoadPackagedLibrary)在应用程序可执行文件中包含
二进制文件,包图和已加载的模块。



Is there a sample (anywhere) of using LoadPackagedLibrary() in a C# project ? See http://msdn.microsoft.com/en-us/library/windows/desktop/hh447159(v=vs.85).aspx

I'm doing a DCA, and need to see if I can access functionality packaged in an existing DLL.

This DLL gets installed in Windows\System32 by our installer, so can we use LoadLibrary()?

Or should we convert the C# sample we started with to a C++ sample ?

We're in the exploratory phase of the project, so we started with CameraCaptureUICS sample, and are adding a section to go see if we can twiddle some bits in our hardware using the DLLs we already have.

Thanks in advance for a speedy answer !

解决方案

No you cannot use LoadPackagedLibrary to load a DLL from the system dir. This is true in C# and C++ - the choice of programming language is mostly immaterial for this discussion. The DLL search order for Metro style apps (via LoadPackagedLibrary) covers the binaries alongside the app executable, in the package graph and modules already loaded.


这篇关于是否有C#示例显示LoadPackagedLibrary的使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆