Board index » cppbuilder » wsprintfW error
Tobias
![]() CBuilder Developer |
Tobias
![]() CBuilder Developer |
wsprintfW error2007-01-21 01:11:11 PM cppbuilder50 Hello! I would like to now how i can use wsprintfW I get this error when i try to use it [C++ Error] Unit2.cpp(179): E2451 Undefined symbol 'wsprintf_instead_use_StringCbPrintf_or_StringCchPrintf' my code: WCHAR wsz[256]; wsprintf(wsz, L"FilterGraph %08x pid %08x", (DWORD_PTR)pUnkGraph, GetCurrentProcessId()); //Tobias |
Remy Lebeau (TeamB)
![]() CBuilder Developer |
2007-01-21 02:30:51 PM
Re:wsprintfW error
"Tobias" < XXXX@XXXXX.COM >wrote in message
QuoteI get this error when i try to use it [C++ Error] Unit2.cpp(179): replaced with StringCbPrintf() and StringCchPrintf(). wsprintf() is deprecated and is considered unsafe. So are similar functions, such as lstrcpy(). Microsoft designed its newer Win32 SDK headers to intentionally fail with linker errors on such functions. In order to see that message in the first place, you obviously have the newer headers installed. So you should do what the message says and use StringCbPrintf() or StringCchPrintf() instead of wsprintf() from now on. Gambit |
Remy Lebeau (TeamB)
![]() CBuilder Developer |
2007-01-21 02:32:15 PM
Re:wsprintfW error
"Tobias" < XXXX@XXXXX.COM >wrote in message
QuoteI would like to now how i can use wsprintfW using, ie: WCHAR wsz[256]; wsprintfW(wsz, L"FilterGraph %08x pid %08x", pUnkGraph, GetCurrentProcessId()); Gambit {smallsort} |