wsprintf deprecated?

B

Ben Rush

When I compile my solution I get the following output -

NET 2003\Vc7\atlmfc\include\atlwin.h(2027) : warning C4995:
'wsprintf': name was marked as #pragma deprecated
C:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\atlmfc\include\atlwin.h(2027) : warning C4995: 'wsprintfA':
name was marked as #pragma deprecated
C:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\atlmfc\include\atlwin.h(2211) : warning C4995: 'wsprintf':
name was marked as #pragma deprecated
C:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\atlmfc\include\atlwin.h(2211) : warning C4995: 'wsprintfA':
name was marked as #pragma deprecated
C:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\atlmfc\include\atlwin.h(3863) : warning C4995: 'lstrcpy':
name was marked as #pragma deprecated
C:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\atlmfc\include\atlwin.h(3863) : warning C4995: 'lstrcpyA':
name was marked as #pragma deprecated

If I'm not suppose to use wsprintf() then what am I suppose to use?
It's quite frustrating for me as I look on the docs for this function
and no mention of it being deprecated can be found. I get the same
thing for lstrcat, lstrlen, etc. I choose to not use strcpy(),
sprintf(), etc. because I'm not using CRT functions. I want to use the
Win32 equivalents.
 
S

Sarat Venugopal

Ben Rush said:
When I compile my solution I get the following output -

NET 2003\Vc7\atlmfc\include\atlwin.h(2027) : warning C4995:
'wsprintf': name was marked as #pragma deprecated

If I'm not suppose to use wsprintf() then what am I suppose to use?
It's quite frustrating for me as I look on the docs for this function
and no mention of it being deprecated can be found. I get the same
thing for lstrcat, lstrlen, etc. I choose to not use strcpy(),
sprintf(), etc. because I'm not using CRT functions. I want to use the
Win32 equivalents.

Use the String* family of functions. StringCchPrintf is probably a
replacement
for wsprintf. Security improvement measures.

BTW. it's all documented in the platform SDK docs.

Sarat Venugopal
www.huelix.com
 
B

Ben Rush

Well, then MS needs to read their own docs because atlbase.h is one of
the sources of the problem.

Is there a way around this or do I have to just turn off the pragma
warnings manually?
 

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