在 AIR 本机扩展中包含外部 DLL



我一直在尝试让 Flex 3.6 中的工作 (AIR 4.6) 本机扩展工作了一段时间。 我的基本项目是运行一个Flash(Flex)UI,并在后台运行C++/CLI DLL本机扩展。 该C++本机扩展在后台进一步使用另一个 C# DLL。

基本上,这个链的原因是让C# DLL运行Kinect相机,这会将数据传递到运行OpenCV的C++DLL,后者将数据传递到Flash UI。

现在,我基本上已经设置好了所有内容,Flash 可以通过本机扩展与 C++ 进行通信,C++可以通过"#using"与 C# 进行通信,它是 DLL。

但是,当我尝试让 Flash 调用本机扩展C++来调用 C# 时,Flex 桌面应用程序崩溃并收到错误:

Process terminated unexpectedly
Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly 'kinect, Version=1.0.0.0, Culture=nutral, PublicKeyToken=null' or one of its dependencies.
The System cannot find the file specified.
    at startCamera(Void* ctx, Void* funcData, Uint32 argc, Void** argv)
Launch command details: "C:Program Files (x86)AdobeAdobe Flash Builder 4.6sdks4.6.0binadl.exe" -runtime "C:Program Files (x86)AdobeAdobe Flash Builder 4.6sdks4.6.0runtimesairwin" -profile extendedDesktop -extdir "C:UsersownerAdobe Flash Builder 4.6.metadata.pluginscom.adobe.flexbuilder.project.uiANEFilesWorkingExtensionwin32" C:UsersownerDesktoFinalWorkingExtensionFlexbin-debugWorkingExtension-app.xml C:UsersownerDesktopFinalWOrkingExtensionFlexbin-debug

据我了解,它找不到kinect.dll(C# DLL)。 我尝试将其放在本机扩展的 ANE 文件中,将其包含在系统 PATH 中,并使用C++项目中的项目属性链接器链接到它。 在这一点上,我有点没有想法。

哦,我已经将错误追溯到C++语句:

kinectClass^ deligate = gcnew kinectClass();

其中 kinectClass 是我在 C# DLL 中创建的 C# 类。

感谢您提供的任何帮助。

你可以看看这个答案: https://stackoverflow.com/a/15264535/88231

为了调试,我复制了 ADL.exe 所在的 DLL 并且它工作了。

最新更新