8 Replies Latest reply on Jun 7, 2007 8:42 AM by peterent

    Flex and C++

    nbharatvarma
      Hi,

      I am developing an application where I would like to use Flex to talk to some dlls / exe installed on the local machine, through a browser.
      The DLLs (and or) EXE will be installed using an installer.

      The workflow I would like working on the client machine is the swf (created by Flex) getting loaded in the browser and communicating with the dlls (win32 c++ dlls) installed on the machine.

      I guess one way would be to use External Interface and do a

      Action Script <-> Java Script <-> ActiveX (for IE) / np dll (for FF)

      However, I would like to avoid installing any new activex control for my application. I do not need any GUI for my application either.

      Is there another way to directly communicate with the dlls and completely avoid activex (or equivalent in FF) ?
        • 1. Re: Flex and C++
          peterent Level 2
          I'm not sure what you want. Flex provides a UI and it runs in the Flash Player, an ActiveX control for IE. So you will need the Flash Player to use Flex. You can use ExternalAPI to communicate with JavaScript. You don't have to have anything visual in the Flex app and could make it a 1x1 (that's one pixel) area on your page.
          • 2. Re: Flex and C++
            nbharatvarma Level 1
            Sorry, I wasn't being clear. I would like to use the GUI provided by Flex but also communicate to locally installed Win32 c++ dlls.

            So my option right now is to use External Interface to talk between Javascript and Flex and then install a separate custom ActiveX control on the local machine, to talk between Javascript and my Win32 dlls. I was wondering if I can avoid using Javascript as my middle-man and directly talk to Win32 dlls using Flex.

            I have tried to look for some examples using Flex, but I didn't get anything relevant.
            • 3. Re: Flex and C++
              peterent Level 2
              Flex, or more correctly, the Flash Player, can only communicate with JavaScript. Being able to directly access Win32 dlls would make the Flash Player Windows-specific and we need to run on other platforms.
              • 4. Re: Flex and C++
                nbharatvarma Level 1
                It makes sense now.

                Thank you.
                • 5. Re: Flex and C++
                  byteybird2
                  Can not Apollo be installed and maintain communication with a C++ program through a file.
                  Apollo provides some API's to the host computer. Looking at the examples, I know there is at least file I/O
                  • 6. Re: Flex and C++
                    peterent Level 2
                    Why not use a socket? Both ActionScript and C++ support sockets.
                    • 7. Re: Flex and C++
                      byteybird2 Level 1
                      Flex only allows socket connectivity to the Server. I have not installed Apolla, so I not sure what it's Host API feature set is?
                      • 8. Re: Flex and C++
                        peterent Level 2
                        Flex, or rather the Flash Player, allows socket connections to any IP address and port that it is authorized to connect to. There's a section in the Flex docs about that. It doesn't have to be a 'server' just a program that serves socket connections.

                        Apollo is the same.