🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.nativeapi
3 messages
3 total messages Started by Tobias Sun, 21 Jan 2007 05:11
wsprintfW error
#2641
Author: Tobias
Date: Sun, 21 Jan 2007 05:11
12 lines
1187 bytes
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 
Re: wsprintfW error
#2643
Author: Remy Lebeau (TeamB)
Date: Sun, 21 Jan 2007 06:30
21 lines
1654 bytes
"Tobias" <toasdf.asdfl2@asdf.se> wrote in message
news:45b2f5d0$1@newsgroups.borland.com...

> I get this error when i try to use it [C++ Error] Unit2.cpp(179):
E2451
> Undefined symbol
'wsprintf_instead_use_StringCbPrintf_or_StringCchPrintf'

The error is intentional.  Like the message says, wsprintf() has been
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
Re: wsprintfW error
#2642
Author: Remy Lebeau (TeamB)
Date: Sun, 21 Jan 2007 06:32
16 lines
1278 bytes
"Tobias" <toasdf.asdfl2@asdf.se> wrote in message
news:45b2f5d0$1@newsgroups.borland.com...

> I would like to now how i can use wsprintfW

If you really want to call wsprintfW(), then you have to call it
explicitally rather than through the macro that you are currently
using, ie:

    WCHAR wsz[256];
    wsprintfW(wsz, L"FilterGraph %08x pid %08x", pUnkGraph,
GetCurrentProcessId());


Gambit
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads