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. vs2019 + v71 + v80

vs2019 + v71 + v80

Scheduled Pinned Locked Moved C / C++ / MFC
visual-studiocsharphelpquestionannouncement
19 Posts 5 Posters 2 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.
  • L Lost User

    I guess that is down to the fact that there have been major changes since VS2003 and VS2005. But, as I mentioned above, you should use the latest toolset that is available.

    H Offline
    H Offline
    hmd omani
    wrote on last edited by
    #8

    it compiled for one of the projects after some tinkering :-D i had to change the debug source files and point them to VC2003 added _CRT_SECURE_NO_DEPRECATE & _XKEYCHECK_H in preprocessors definitions and fixed some codes it runs even better than before, i have no clue how or why :laugh: ill try & do the same to the other projects and maybe i will get lucky

    L 1 Reply Last reply
    0
    • H hmd omani

      it compiled for one of the projects after some tinkering :-D i had to change the debug source files and point them to VC2003 added _CRT_SECURE_NO_DEPRECATE & _XKEYCHECK_H in preprocessors definitions and fixed some codes it runs even better than before, i have no clue how or why :laugh: ill try & do the same to the other projects and maybe i will get lucky

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #9

      Why do you insist on using out of date toolsets? Whatever short term improvements you might see there is a potential for major problems suddenly appearing.

      H 1 Reply Last reply
      0
      • L Lost User

        Why do you insist on using out of date toolsets? Whatever short term improvements you might see there is a potential for major problems suddenly appearing.

        H Offline
        H Offline
        hmd omani
        wrote on last edited by
        #10

        im not insisting on anything, im just a hobbyist, what choice do i have? im just trying to make working with these projects easier. if you like i can send you the codes and you can fix them for me, but i dont think you or anyone here would do that, so here i am only asking questions.

        L 1 Reply Last reply
        0
        • H hmd omani

          im not insisting on anything, im just a hobbyist, what choice do i have? im just trying to make working with these projects easier. if you like i can send you the codes and you can fix them for me, but i dont think you or anyone here would do that, so here i am only asking questions.

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #11

          hmd-omani wrote:

          what choice do i have?

          As I keep telling you, the simple choice: use the toolset that goes with the version of Visual Studio that you are using.

          H 1 Reply Last reply
          0
          • L Lost User

            hmd-omani wrote:

            what choice do i have?

            As I keep telling you, the simple choice: use the toolset that goes with the version of Visual Studio that you are using.

            H Offline
            H Offline
            hmd omani
            wrote on last edited by
            #12

            so far so good but with my last project i got this warning c4474 saying too many arguments :( sscanf(parm, "%%.2f", &f ); i added the extra % and it removed one warning already any clues?

            L Mircea NeacsuM 2 Replies Last reply
            0
            • H hmd omani

              so far so good but with my last project i got this warning c4474 saying too many arguments :( sscanf(parm, "%%.2f", &f ); i added the extra % and it removed one warning already any clues?

              L Offline
              L Offline
              Lost User
              wrote on last edited by
              #13

              Too many % characters there. Remember in a printf/scanf format the % is the control character, so two of them means print (or read) a single "%" character. So in your call it expects to read a string of the form "%.2f", and requires no parameters. It should be:

              sscanf(parm, "%5f", &f ); // single % character to introduce the format, read up to 5 character float value.

              [edit] The width value for scanf indicates the maximum number of characters to read for that field, so does not require the dot prefix, but should be large enough for the largest number. See updated code. [/edit]

              H 1 Reply Last reply
              0
              • H hmd omani

                so far so good but with my last project i got this warning c4474 saying too many arguments :( sscanf(parm, "%%.2f", &f ); i added the extra % and it removed one warning already any clues?

                Mircea NeacsuM Offline
                Mircea NeacsuM Offline
                Mircea Neacsu
                wrote on last edited by
                #14

                That’s a good example of why you should upgrade to a new toolset: sscanf is a variadic function with a variable number of arguments. Older toolsets didn’t bother to do any analysis on the arguments while the newer ones interpret the format string the same way it would be interpreted at runtime and check if the arguments match. In your case they don’t because the ‘%’ sign looses it’s special function if it is escaped by another ‘%’ sign. VC19 is just trying to warn you about a probable bug in your code.

                Mircea

                H 1 Reply Last reply
                0
                • Mircea NeacsuM Mircea Neacsu

                  That’s a good example of why you should upgrade to a new toolset: sscanf is a variadic function with a variable number of arguments. Older toolsets didn’t bother to do any analysis on the arguments while the newer ones interpret the format string the same way it would be interpreted at runtime and check if the arguments match. In your case they don’t because the ‘%’ sign looses it’s special function if it is escaped by another ‘%’ sign. VC19 is just trying to warn you about a probable bug in your code.

                  Mircea

                  H Offline
                  H Offline
                  hmd omani
                  wrote on last edited by
                  #15

                  i didn't change the platform toolsets, only the debug source files

                  Mircea NeacsuM 1 Reply Last reply
                  0
                  • L Lost User

                    Too many % characters there. Remember in a printf/scanf format the % is the control character, so two of them means print (or read) a single "%" character. So in your call it expects to read a string of the form "%.2f", and requires no parameters. It should be:

                    sscanf(parm, "%5f", &f ); // single % character to introduce the format, read up to 5 character float value.

                    [edit] The width value for scanf indicates the maximum number of characters to read for that field, so does not require the dot prefix, but should be large enough for the largest number. See updated code. [/edit]

                    H Offline
                    H Offline
                    hmd omani
                    wrote on last edited by
                    #16

                    why change the 2 to 5? i removed the dot between % and 2 and it worked, i dont know if thats fine or not if i kept at 2?

                    L 1 Reply Last reply
                    0
                    • H hmd omani

                      why change the 2 to 5? i removed the dot between % and 2 and it worked, i dont know if thats fine or not if i kept at 2?

                      L Offline
                      L Offline
                      Lost User
                      wrote on last edited by
                      #17

                      Because that is the maximum number of characters it will scan. So %2f will not work for 1.75, or 11.6 for example. [edit] Try this code, it will show you what I mean:

                      char zzz[32];
                      char* pp = "23.58";
                      float ff;
                      sscanf(pp, "%2f%s", &ff, zzz);
                      printf("Number is: %.2f\n", ff);
                      printf("String is: %s\n", zzz);

                      [/edit]

                      1 Reply Last reply
                      0
                      • H hmd omani

                        i didn't change the platform toolsets, only the debug source files

                        Mircea NeacsuM Offline
                        Mircea NeacsuM Offline
                        Mircea Neacsu
                        wrote on last edited by
                        #18

                        Not sure what you mean by changing only the debug source. There are however two problems with your format specifier: - sscanf formats do not have a point for number of decimal places (unlike printf formats). - percent sign must be escaped to read a percent sign from the input. So, if you want to read something like "%12.34", the correct sscanf format is "%%%5f". VS2019 warns you if you are missing the triple percent because the last argument of sscanf will not used.

                        Mircea

                        1 Reply Last reply
                        0
                        • H hmd omani

                          not sure where to post this but i have a number of old projects that build pretty well with visual studio 2003 and 2005 but i dont want to jump around between two versions, i want to use the latest version of VS for both projects my real problem is that VS2019 platform toolset option doesnt have V71 or V80 anyway i can point it to the actual versions i have already installed to build the projects? thanks

                          N Offline
                          N Offline
                          Nynennnav
                          wrote on last edited by
                          #19

                          Oxford-Heathrow Airport taxi transfers: taxi to Heathrow & taxi from Heathrow Airport. AtoB airport taxi picks you up at Heathrow airport and take to Oxford.

                          Taxi to Heathrow & Taxi from Heathrow Airport | AtoB Taxi[^]

                          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