Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. DDE Messages

DDE Messages

Scheduled Pinned Locked Moved C / C++ / MFC
questioncom
7 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Mustafa Demirhan
    wrote on last edited by
    #1

    How can I register one file type with my application? I want my application to open all files that have the extension of ".tsx". I also would like to use DDE because I one instance of my program is always running and I do not want to run another instance. All I want is to send a message to the running instance. I am looking forward to hearing from you guys Mustafa Demirhan http://www.macroangel.com Sonork ID 100.9935:zoltrix

    They say I'm lazy but it takes all my time

    S 1 Reply Last reply
    0
    • M Mustafa Demirhan

      How can I register one file type with my application? I want my application to open all files that have the extension of ".tsx". I also would like to use DDE because I one instance of my program is always running and I do not want to run another instance. All I want is to send a message to the running instance. I am looking forward to hearing from you guys Mustafa Demirhan http://www.macroangel.com Sonork ID 100.9935:zoltrix

      They say I'm lazy but it takes all my time

      S Offline
      S Offline
      Stephane Rodriguez
      wrote on last edited by
      #2

      More than one hundred native Windows apps are using DDE file association already. So I guess it's not cumbersome to find them. First thing to do is in Windows Explorer file association, check the use DDE checkbox, and type Open("%1") as DDE message, and system as Topic. This in itself in almost enough (depending then on how you handle default verbs in your apps).


      sometimes it helps to look at the IL generated code a MS guy on develop.com "answering" .NET issues

      M 1 Reply Last reply
      0
      • S Stephane Rodriguez

        More than one hundred native Windows apps are using DDE file association already. So I guess it's not cumbersome to find them. First thing to do is in Windows Explorer file association, check the use DDE checkbox, and type Open("%1") as DDE message, and system as Topic. This in itself in almost enough (depending then on how you handle default verbs in your apps).


        sometimes it helps to look at the IL generated code a MS guy on develop.com "answering" .NET issues

        M Offline
        M Offline
        Mustafa Demirhan
        wrote on last edited by
        #3

        In fact I did that. But when I do that, CWinApp tries to open the file on its own. But what I want is to do different things but I could not figure out how to. I overrided CWinApp::OnDDECommand () but this method is never called :( Mustafa Demirhan http://www.macroangel.com Sonork ID 100.9935:zoltrix

        They say I'm lazy but it takes all my time

        S 1 Reply Last reply
        0
        • M Mustafa Demirhan

          In fact I did that. But when I do that, CWinApp tries to open the file on its own. But what I want is to do different things but I could not figure out how to. I overrided CWinApp::OnDDECommand () but this method is never called :( Mustafa Demirhan http://www.macroangel.com Sonork ID 100.9935:zoltrix

          They say I'm lazy but it takes all my time

          S Offline
          S Offline
          Stephane Rodriguez
          wrote on last edited by
          #4

          You must also have this in your CWinApp implementation :

          // enable file manager drag/drop and DDE Execute open
          EnableShellOpen();
          RegisterShellFileTypes();
          // ...

          And you have MSDN articles [^]about it. From a former app I somewhat remember, I also had a WIN32 message loop scrutening for WM_DDE_xxx messages. But this advanced advanced DDE use to transfer data using the clipboard.


          sometimes it helps to look at the IL generated code a MS guy on develop.com "answering" .NET issues

          M 3 Replies Last reply
          0
          • S Stephane Rodriguez

            You must also have this in your CWinApp implementation :

            // enable file manager drag/drop and DDE Execute open
            EnableShellOpen();
            RegisterShellFileTypes();
            // ...

            And you have MSDN articles [^]about it. From a former app I somewhat remember, I also had a WIN32 message loop scrutening for WM_DDE_xxx messages. But this advanced advanced DDE use to transfer data using the clipboard.


            sometimes it helps to look at the IL generated code a MS guy on develop.com "answering" .NET issues

            M Offline
            M Offline
            Mustafa Demirhan
            wrote on last edited by
            #5

            Thanks a lot. This is a good start for me. But I still get error messages. I added these two lines, but OnDDECommand is never called. All I get is a stupid error message: "Windows cannot find 'c:\temp\yourfile.tsx'. Make sure that you typed the name correctly, and then try again. To search a file, .....". The error message directly comes from Windows Explorer and then my program is executed. But it never calls OnDDECommand. I don't know what's going on there :confused: Mustafa Demirhan http://www.macroangel.com Sonork ID 100.9935:zoltrix

            They say I'm lazy but it takes all my time

            1 Reply Last reply
            0
            • S Stephane Rodriguez

              You must also have this in your CWinApp implementation :

              // enable file manager drag/drop and DDE Execute open
              EnableShellOpen();
              RegisterShellFileTypes();
              // ...

              And you have MSDN articles [^]about it. From a former app I somewhat remember, I also had a WIN32 message loop scrutening for WM_DDE_xxx messages. But this advanced advanced DDE use to transfer data using the clipboard.


              sometimes it helps to look at the IL generated code a MS guy on develop.com "answering" .NET issues

              M Offline
              M Offline
              Mustafa Demirhan
              wrote on last edited by
              #6

              Upps. One correction: First my program is started and then the error message comes directly from Windows Explorer :omg: Mustafa Demirhan http://www.macroangel.com Sonork ID 100.9935:zoltrix

              They say I'm lazy but it takes all my time

              1 Reply Last reply
              0
              • S Stephane Rodriguez

                You must also have this in your CWinApp implementation :

                // enable file manager drag/drop and DDE Execute open
                EnableShellOpen();
                RegisterShellFileTypes();
                // ...

                And you have MSDN articles [^]about it. From a former app I somewhat remember, I also had a WIN32 message loop scrutening for WM_DDE_xxx messages. But this advanced advanced DDE use to transfer data using the clipboard.


                sometimes it helps to look at the IL generated code a MS guy on develop.com "answering" .NET issues

                M Offline
                M Offline
                Mustafa Demirhan
                wrote on last edited by
                #7

                I found my mistake: As the topic in Windows explorer I forgot to write "system". After I made the correction, everthing works great! Mustafa Demirhan http://www.macroangel.com Sonork ID 100.9935:zoltrix

                They say I'm lazy but it takes all my time

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups