2012-06-21 35 views
2

我一直在嘗試讓Flex 4.6中的工作(AIR 3)本機擴展工作一段時間。我的基本項目是使用在後臺運行的C++/CLI DLL Native Extension運行的Flash(Flex)UI。該C++本機擴展在後臺進一步使用另一個C#DLL。在AIR本機擴展中包含外部DLL

基本上,這條鏈的原因是讓C#DLL運行一個Kinect相機,它將數據傳遞給一個運行OpenCV的C++ DLL,它將數據傳遞給Flash UI。

現在,我已經基本設置了一切,Flash可以通過本機擴展與C++和C++通過「#using」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)\Adobe\Adobe Flash Builder 4.6\sdks\4.6.0\bin\adl.exe" -runtime "C:\Program Files (x86)\Adobe\Adobe Flash Builder 4.6\sdks\4.6.0\runtimes\air\win" -profile extendedDesktop -extdir "C:\Users\owner\Adobe Flash Builder 4.6\.metadata\.plugins\com.adobe.flexbuilder.project.ui\ANEFiles\WorkingExtension\win32\" C:\Users\owner\Deskto\FinalWorkingExtension\Flex\bin-debug\WorkingExtension-app.xml C:\Users\owner\Desktop\FinalWOrkingExtension\Flex\bin-debug 

據我瞭解,它不能找到的kinect .dll(C#DLL)。我試過把它放在原生擴展的ANE文件中,包括它在系統路徑中,並用C++項目中的項目屬性鏈接器鏈接到它。在這一點上,我有種想法。

哦,我已經跟蹤誤差降低到C++聲明:

kinectClass^ deligate = gcnew kinectClass(); 

其中kinectClass是我在C#DLL創建的C#類。

謝謝你提供的任何幫助。

+0

kinect.dll在應用程序目錄中?在C++的dll代碼中,這個目錄是最新的嗎? ('Directory.GetCurrentDirectory') – alxx

回答

相關問題