了解Windows Store App DLL加载失败的原因 [英] Knowing the reason of DLL loading failed for Windows Store App

查看:105
本文介绍了了解Windows Store App DLL加载失败的原因的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试在Windows 8 Store App中使用 EmguCV 库.以前,它在Windows 7桌面应用程序项目中可以正常工作.

I tried to use EmguCV library in Windows 8 Store App. Previously, it works fine for a Windows 7 Desktop App project.

我确保我的Windows 8 Store App项目目录[ C:\ Projects \ App2 \ App2 \ bin \ Debug ]具有所有必需的DLL文件.

I ensure my Windows 8 Store App project directory [C:\Projects\App2\App2\bin\Debug] is having all the necessary DLLs file.

当我通过本地计算机按钮直接在 Microsoft Visual Studio 2012 Ultimate 中执行时,出现以下异常.

When I execute directly in Microsoft Visual Studio 2012 Ultimate through Local Machine button, I get the following exception.

异常:抛出:无法加载DLL'opencv_core240':指定 找不到模块. (来自HRESULT的异常:0x8007007E)" (System.DllNotFoundException)一个System.DllNotFoundException是 抛出:无法加载DLL'opencv_core240':指定的模块 找不到. (来自HRESULT的异常:0x8007007E)"

Exception:Thrown: "Unable to load DLL 'opencv_core240': The specified module could not be found. (Exception from HRESULT: 0x8007007E)" (System.DllNotFoundException) A System.DllNotFoundException was thrown: "Unable to load DLL 'opencv_core240': The specified module could not be found. (Exception from HRESULT: 0x8007007E)"

我的问题是:如何知道故障是否是由于Windows 8 Store App 无法找到DLL文件引起的?还是找到的DLL文件不是Windows 8 Store App期望的格式? (对于Windows 7桌面软件,DLL是可以的)

My question is : How can I know whether the failure is caused by my Windows 8 Store App unable to locate the DLL files? Or, the located DLL files is not in the format expected by Windows 8 Store App? (The DLLs are OK for Windows 7 desktop software)

如果原因是Windows 8 Store App无法识别该格式引起的,请重新编译整个DLL项目(OpenCV源代码在C ++中,而充当包装器的EmguCV在C#中)在 Windows Store->类库(Windows Store应用程序)会有所帮助吗?

If the reason is caused by the format is not recognized by Windows 8 Store App, does re-compile the whole DLL project (The OpenCV source code is in C++, and EmguCV which acts as a wrapper is in C#) under Windows Store -> Class Library (Windows Store apps) will help?

推荐答案

如果这些dll适用于Windows 7桌面应用程序,则它们不适用于Windows 8 Metro应用程序,因为这是完全不同的平台和API.您不能在Windows 8 WinRT项目中仅加载任何dll.

If these dlls worked for Windows 7 desktop apps, then they won't work for Windows 8 Metro apps, because it's completely different platform and API. You cannot load just any dll in your Windows 8 WinRT project.

如果您具有该dll的源代码,则可以尝试将其重新编译为Windows运行时组件,然后很有可能使用WinRT中不可用的API来编写原始代码.

If you have source code for the dll, you can try to recompile it as a Windows Runtime Component, byt there is a strong possibility the original code used APIs not available in WinRT.

这篇关于了解Windows Store App DLL加载失败的原因的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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