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. File Type Extensions

File Type Extensions

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestionlearning
7 Posts 4 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
    maycockt
    wrote on last edited by
    #1

    Hi, I'm having a small issue with associating the extension of my files with my application. I'm wanting to use a 2 character extension for my files. Is this inherently wrong, or should it associate? My resource string is as follows and seems to be ok IDR_MAINFRAME "Ext File\nFile\nExt\nInstall Files (*.a1)\n.a1\NewFile.Document\nNewFile Document" Any ideas? Tony

    D T M 3 Replies Last reply
    0
    • M maycockt

      Hi, I'm having a small issue with associating the extension of my files with my application. I'm wanting to use a 2 character extension for my files. Is this inherently wrong, or should it associate? My resource string is as follows and seems to be ok IDR_MAINFRAME "Ext File\nFile\nExt\nInstall Files (*.a1)\n.a1\NewFile.Document\nNewFile Document" Any ideas? Tony

      D Offline
      D Offline
      David Crow
      wrote on last edited by
      #2

      What's the problem?

      "One man's wage rise is another man's price increase." - Harold Wilson

      "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

      "Man who follows car will be exhausted." - Confucius

      M 1 Reply Last reply
      0
      • M maycockt

        Hi, I'm having a small issue with associating the extension of my files with my application. I'm wanting to use a 2 character extension for my files. Is this inherently wrong, or should it associate? My resource string is as follows and seems to be ok IDR_MAINFRAME "Ext File\nFile\nExt\nInstall Files (*.a1)\n.a1\NewFile.Document\nNewFile Document" Any ideas? Tony

        T Offline
        T Offline
        ThatsAlok
        wrote on last edited by
        #3

        maycockt wrote:

        IDR_MAINFRAME "Ext File\nFile\nExt\nInstall Files (*.a1)\n.a1\NewFile.Document\nNewFile Document"

        isn't it assocaited?

        "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
        Never mind - my own stupidity is the source of every "problem" - Mixture

        cheers, Alok Gupta VC Forum Q&A :- I/IV Support CRY- Child Relief and You

        1 Reply Last reply
        0
        • D David Crow

          What's the problem?

          "One man's wage rise is another man's price increase." - Harold Wilson

          "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

          "Man who follows car will be exhausted." - Confucius

          M Offline
          M Offline
          maycockt
          wrote on last edited by
          #4

          Hi David, When double clicking on a file with a ".a1" extension it doesnt launch my application. I'm assuming therfore that it isnt associated with my application. It also does not display the application icon, which I understood it should. My complete code, for what it's worth, to load the SingleDocTemplate is as follows

          CSingleDocTemplate* pDocTemplate = new CSingleDocTemplate(IDR_MAINFRAME,
          RUNTIME_CLASS(CProgDoc),
          RUNTIME_CLASS(CMainFrame), // main SDI frame window
          RUNTIME_CLASS(CProgView));
          AddDocTemplate(pDocTemplate);

          IDR_MAINFRAME is as per the original post Thanks Tony

          D 1 Reply Last reply
          0
          • M maycockt

            Hi David, When double clicking on a file with a ".a1" extension it doesnt launch my application. I'm assuming therfore that it isnt associated with my application. It also does not display the application icon, which I understood it should. My complete code, for what it's worth, to load the SingleDocTemplate is as follows

            CSingleDocTemplate* pDocTemplate = new CSingleDocTemplate(IDR_MAINFRAME,
            RUNTIME_CLASS(CProgDoc),
            RUNTIME_CLASS(CMainFrame), // main SDI frame window
            RUNTIME_CLASS(CProgView));
            AddDocTemplate(pDocTemplate);

            IDR_MAINFRAME is as per the original post Thanks Tony

            D Offline
            D Offline
            David Crow
            wrote on last edited by
            #5

            maycockt wrote:

            When double clicking on a file with a ".a1" extension it doesnt launch my application.

            Does HKEY_CLASSES_ROOT\.a1 exist in the registry? If so, does it have a default value?

            "One man's wage rise is another man's price increase." - Harold Wilson

            "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

            "Man who follows car will be exhausted." - Confucius

            1 Reply Last reply
            0
            • M maycockt

              Hi, I'm having a small issue with associating the extension of my files with my application. I'm wanting to use a 2 character extension for my files. Is this inherently wrong, or should it associate? My resource string is as follows and seems to be ok IDR_MAINFRAME "Ext File\nFile\nExt\nInstall Files (*.a1)\n.a1\NewFile.Document\nNewFile Document" Any ideas? Tony

              M Offline
              M Offline
              maycockt
              wrote on last edited by
              #6

              OK, problem partially solved. I added RegisterShellFileTypes after my AddDocTemplate(), but the assocation is shown with a small sized icon, not the standard size icon you would expect to see if you were viewing a file list with "details" selected from Windows Explorer. How can I affect the associated icon? TIA Tony

              A 1 Reply Last reply
              0
              • M maycockt

                OK, problem partially solved. I added RegisterShellFileTypes after my AddDocTemplate(), but the assocation is shown with a small sized icon, not the standard size icon you would expect to see if you were viewing a file list with "details" selected from Windows Explorer. How can I affect the associated icon? TIA Tony

                A Offline
                A Offline
                Avi Berger
                wrote on last edited by
                #7

                Check the icon file that you are using. It does not/should not contain just one image. It should contain multiple versions with different color depths and sizes. (You may have to look around in your icon editor to see how to move between these versions.) You may be missing a needed size/color depth version, so Windows is trying to make due with something else. For some more information see here[^] and here[^].

                Please do not read this signature.

                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