2

I've been trying to get a working (AIR 3) Native Extension in Flex 4.6 working for a while now. My basic project is to have a Flash (Flex) UI running with a C++/CLI DLL Native Extension running in the background. That C++ Native Extension uses another C# DLL further in the background.

Basically, the reason for this chain was to have C# DLL running a Kinect camera, which would pass data to a C++ DLL running OpenCV, which would pass data to a Flash UI.

Now, I have basically everything set up, Flash can communicate though the Native Extension to C++ and C++ can communicate to C# via "#using" it's DLL.

However, when I try to have Flash call the Native Extension C++ to call the C#, the Flex desktop app crashes and I get the error:

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

As I understand it, it cannot find the kinect.dll (C# DLL). I've tried putting it in the ANE file for the Native Extension, including it in the system PATH, and linking to it with the project property linker in the C++ project. I'm kind of out of ideas at this point.

Oh, I've traced the error down to the C++ statement:

kinectClass^ deligate = gcnew kinectClass();

where kinectClass is the C# class that I created in the C# DLL.

Thank you for whatever help you can offer.

user1449837
  • 51
  • 1
  • 1
  • 6
  • kinect.dll is in app directory? In C++ dll code, is this directory current? (`Directory.GetCurrentDirectory`) – alxx Jun 21 '12 at 09:41

1 Answers1

0

You can take a look at this answer: https://stackoverflow.com/a/15264535/88231

For debugging I copied my DLL where the ADL.exe is located and it worked.

Community
  • 1
  • 1
sw.
  • 3,240
  • 2
  • 33
  • 43