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. Windows Version

Windows Version

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestionannouncement
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.
  • G Offline
    G Offline
    G_S
    wrote on last edited by
    #1

    Hi I have a project that is dependent on some of the laiter windows platforms for some of it's functionallity so the question is is there a way of determinig the OS running. and how many different windows platforms are there. can anyone help me. G_S

    S C J 3 Replies Last reply
    0
    • G G_S

      Hi I have a project that is dependent on some of the laiter windows platforms for some of it's functionallity so the question is is there a way of determinig the OS running. and how many different windows platforms are there. can anyone help me. G_S

      S Offline
      S Offline
      Shog9 0
      wrote on last edited by
      #2

      G_S wrote: how many different windows platforms are there. Lots. I'm serious - if you factor in all the various versions of IE, the service packs, the Win9x and WinNT lines, it's a frighteningly large number. Generally, if you wish to use an API that only exists in certain versions, you're best finding a way to include the redistributable for that API along with your install. Failing that, test for the existence of the API prior to using it (for regular APIs, that usually means LoadLibrary() + GetProcAddress() rather than static linking). For other platform-dependant functionality (such as registry locations, file formats), you're gonna have to either get more creative, or write for the lowest common denominator.

      You must be careful in the forest Broken glass and rusty nails If you're to bring back something for us I have bullets for sale...

      G 1 Reply Last reply
      0
      • S Shog9 0

        G_S wrote: how many different windows platforms are there. Lots. I'm serious - if you factor in all the various versions of IE, the service packs, the Win9x and WinNT lines, it's a frighteningly large number. Generally, if you wish to use an API that only exists in certain versions, you're best finding a way to include the redistributable for that API along with your install. Failing that, test for the existence of the API prior to using it (for regular APIs, that usually means LoadLibrary() + GetProcAddress() rather than static linking). For other platform-dependant functionality (such as registry locations, file formats), you're gonna have to either get more creative, or write for the lowest common denominator.

        You must be careful in the forest Broken glass and rusty nails If you're to bring back something for us I have bullets for sale...

        G Offline
        G Offline
        G_S
        wrote on last edited by
        #3

        Thanx It's Actually only the API and specifically the tool help functions. I was really hopping for something nicer to read. so this leaves me with no way around the LoadLibrary ,GetProcAddress .. Thank you anyway G_S

        1 Reply Last reply
        0
        • G G_S

          Hi I have a project that is dependent on some of the laiter windows platforms for some of it's functionallity so the question is is there a way of determinig the OS running. and how many different windows platforms are there. can anyone help me. G_S

          C Offline
          C Offline
          Christian Graus
          wrote on last edited by
          #4

          G_S wrote: is there a way of determinig the OS running. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sysinfo/base/osversioninfo_str.asp[^] But like Shog said, if you use unsupported API's, then you need to dynamically load them, or your app won't run, even if you never run the code that calls them. The alternative is to write your own versions. I did that with TransparentBlt and AlphaBlend many years ago, so I could support W95 and still call them. G_S wrote: how many different windows platforms are there. Assuming you start with W95, there's W95, W98, NT4, WME, W2000, WXP. Then W98 has service pack 2 to consider, that added a lot, from memory. Christian Graus - Microsoft MVP - C++

          G 1 Reply Last reply
          0
          • C Christian Graus

            G_S wrote: is there a way of determinig the OS running. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sysinfo/base/osversioninfo_str.asp[^] But like Shog said, if you use unsupported API's, then you need to dynamically load them, or your app won't run, even if you never run the code that calls them. The alternative is to write your own versions. I did that with TransparentBlt and AlphaBlend many years ago, so I could support W95 and still call them. G_S wrote: how many different windows platforms are there. Assuming you start with W95, there's W95, W98, NT4, WME, W2000, WXP. Then W98 has service pack 2 to consider, that added a lot, from memory. Christian Graus - Microsoft MVP - C++

            G Offline
            G Offline
            G_S
            wrote on last edited by
            #5

            Thank you for the link. So the best work around the dependencies is to dynamically load and test for the functins. Thanks for the anwser this helps. G_S

            C 1 Reply Last reply
            0
            • G G_S

              Thank you for the link. So the best work around the dependencies is to dynamically load and test for the functins. Thanks for the anwser this helps. G_S

              C Offline
              C Offline
              Christian Graus
              wrote on last edited by
              #6

              No, the best way is to use the link I gave you to find out what OS you have, then to dynamically load the functions and only allow the code to use them based on the results of that test, which will have told you if they are present, based on OS version. There's only one test involved, the dynamic loading is because otherwise Windows will try to load the functions, even if they don't exist, regardless of the fact that your code deals with that problem for you. Christian Graus - Microsoft MVP - C++

              1 Reply Last reply
              0
              • G G_S

                Hi I have a project that is dependent on some of the laiter windows platforms for some of it's functionallity so the question is is there a way of determinig the OS running. and how many different windows platforms are there. can anyone help me. G_S

                J Offline
                J Offline
                Jack Puppy
                wrote on last edited by
                #7

                I use this code snippet

                :suss: Pssst. You see that little light on your monitor? That's actually a government installed spy camera. Smile and wave to big brother!

                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