sprintf_s downgrade possible ?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • PawelSokolowski

    sprintf_s downgrade possible ?

    Hi all,

    I was not aware that VS2008 does not build NT 4.0 valid applications, and I
    migrated from VS2003 to VS2008
    Unfortunatelly one of my client still uses NT on about 200 computers, and
    cannot upgrade to XP, they are simply too old.

    While migrating I made about 1800 changes in code, and I don't really like
    the idea of changing everything back.
    Many of those changes were securing sprintf function.
    sprintf(...) -sprintf_s(...)

    Do you have some idea about compiling sprintf_s under VS2003 ???

    I doule like to create a sprintf_s function, passing arguments to regular
    sprintf.
    Since it has variable list of arguments, I have a problem how to pass them.
    I would appreciate any suggestions.


    Regards
    Pawel



  • David Lowndes

    #2
    Re: sprintf_s downgrade possible ?

    >I was not aware that VS2008 does not build NT 4.0 valid applications

    Out of interest, what aspects prevent VS2008 built applications
    running on NT4?

    Dave

    Comment

    • SvenC

      #3
      Re: sprintf_s downgrade possible ?

      Hi David,
      >I was not aware that VS2008 does not build NT 4.0 valid applications
      >
      Out of interest, what aspects prevent VS2008 built applications
      running on NT4?
      The CRT (and possibly MFC) depend on newer versions of Windows.
      Building a win32 app form scratch without CRT and MFC should still work.

      --
      SvenC

      Comment

      • Ben Voigt [C++ MVP]

        #4
        Re: sprintf_s downgrade possible ?

        PawelSokolowski wrote:
        Hi all,
        >
        I was not aware that VS2008 does not build NT 4.0 valid applications,
        and I migrated from VS2003 to VS2008
        Unfortunatelly one of my client still uses NT on about 200 computers,
        and cannot upgrade to XP, they are simply too old.
        >
        While migrating I made about 1800 changes in code, and I don't really
        like the idea of changing everything back.
        Many of those changes were securing sprintf function.
        sprintf(...) -sprintf_s(...)
        >
        Do you have some idea about compiling sprintf_s under VS2003 ???
        >
        I doule like to create a sprintf_s function, passing arguments to
        regular sprintf.
        Since it has variable list of arguments, I have a problem how to pass
        them. I would appreciate any suggestions.
        vsprintf
        >
        >
        Regards
        Pawel

        Comment

        • Giovanni Dicanio

          #5
          Re: sprintf_s downgrade possible ?


          "PawelSokolowsk i" <PeeS290@wp.plh a scritto nel messaggio
          news:Oa%23pub22 IHA.5060@TK2MSF TNGP02.phx.gbl. ..
          Many of those changes were securing sprintf function.
          sprintf(...) -sprintf_s(...)
          >
          Do you have some idea about compiling sprintf_s under VS2003 ???
          In addition to what others wrote, you may consider also StringCchPrintf
          function:



          it is available in VS.NET 2003, too.

          HTH,
          Giovanni


          Comment

          • PawelSokolowski

            #6
            Re: sprintf_s downgrade possible ?

            >Since it has variable list of arguments, I have a problem how to pass
            >them. I would appreciate any suggestions.
            >
            vsprintf

            could you be more specific ?


            Comment

            • PawelSokolowski

              #7
              Re: sprintf_s downgrade possible ?

              vsprintf

              I got it, thanks

              Regards
              Pawel


              Comment

              • PawelSokolowski

                #8
                Re: sprintf_s downgrade possible ?

                In addition to what others wrote, you may consider also StringCchPrintf
                Giovanni
                >

                Thanks Giovanni,
                This is pretty simple solution :)

                Regards
                Pawel


                Comment

                • Giovanni Dicanio

                  #9
                  Re: sprintf_s downgrade possible ?


                  "PawelSokolowsk i" <PeeS290@wp.plh a scritto nel messaggio
                  news:OWhiBc62IH A.4272@TK2MSFTN GP03.phx.gbl...
                  >In addition to what others wrote, you may consider also StringCchPrintf
                  >Giovanni
                  >>
                  >
                  >
                  Thanks Giovanni,
                  This is pretty simple solution :)
                  You're welcome.

                  Sometimes simple solutions can do a good job :)

                  Giovanni



                  Comment

                  Working...