sprintf_s downgrade possible ?

  • Thread starter PawelSokolowski
  • Start date
P

PawelSokolowski

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
 
D

David Lowndes

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
 
S

SvenC

Hi David,
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.
 
B

Ben Voigt [C++ MVP]

PawelSokolowski said:
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
 
P

PawelSokolowski

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


Thanks Giovanni,
This is pretty simple solution :)

Regards
Pawel
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top