New essay: ToString
- From: Joseph M. Newcomer <newcomer@xxxxxxxxxxxx>
- Date: Tue, 10 Jul 2007 15:46:56 -0400
So I had to take time to watch the plumbers replace a leaky valve...so I spent the time
writing a little essay on a function called ToString, which takes a formatting string and
arguments and lets you write something like
c_Coordinates.SetWindowText( ToString( _T("(%d,%d)"), pt.x, pt.y) );
note that no intermediate CString variable or FormatString was required. It is so simple
(6 lines of code) that there isn't even a download, you can copy right off the Web page
(it is overloaded so there is a form that takes a UINT which is a STRINGTABLE form, and
that takes a whopping eight lines total!)
Now if I could only get them to help me with my current handle leak...
joe
Joseph M. Newcomer [MVP]
email: newcomer@xxxxxxxxxxxx
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
.
- Follow-Ups:
- Re: New essay: ToString
- From: Mihajlo Cvetanovic
- Re: New essay: ToString
- From: Tom Serface
- Re: New essay: ToString
- From: Giovanni Dicanio
- Re: New essay: ToString
- Prev by Date: Re: Memory leak with CAsyncSocket::Create
- Next by Date: Re: Avoiding Updates After Displaying Menus
- Previous by thread: Re: Avoiding Updates After Displaying Menus
- Next by thread: Re: New essay: ToString
- Index(es):
Relevant Pages
|
Loading