3 Replies Latest reply on Dec 14, 2007 6:27 PM by Sreenivas R

    Flex And External C++ DLL


      I am working on an application which requires me to access hardware (like USB devices) from a Flex app. I have code a DLL using ATL to talk to the hardware device. Now how do I integrate it with Flex? Is it even possible to talk to a C++ DLL from a Flex App? I couldn’t find any examples/documentation for this on the web.

        • 1. Re: Flex And External C++ DLL
          Sreenivas R Adobe Employee
          have an old sample in which calls were being exchanged between a Flex app and a ActiveX C++ DLL. You can find the source code here


          The sample has two portions a flex app called CalledApp and a C++ DLL called CallingDLL. Load the CalledApp project in FlexBuilder and CallingDLL project is Visual Studio 2003 or later.

          Build the DLL and the Flex app. Run the Flex app and click on the button. When flex app calls the DLL function the DLL calls back the flex app.

          Hope this helps.

          If you have any questions feel free to mail me at sreenivas.ramaswamy@gmail.com
          • 2. Re: Flex And External C++ DLL
            RoyBobb Level 1
            Thanks for the source code. If I understand it correctly, your app is using Javascipt as the bridge. Is it possible to do it without Javascript? I already wrote a test project which uses JS as the bridge. What I am interested in is calling the DLL directly from Flex App.
            • 3. Re: Flex And External C++ DLL
              Sreenivas R Adobe Employee
              I think Javascript is the only language Flash player allows to be used through the ExternalInterface mechanism, which is the only way to talk to outside world from a SWF.

              However there is no JavaScript written in HTML in the sample. The java script is used only to initialize the ActiveX object and later on it is ExternalInterface calls which are used.