Advertisement

i don't know if the problem is in my wsprintf(...) or in the WM_MOUSEMOVE..,

Started by July 05, 2002 10:12 PM
17 comments, last by mickey 22 years, 5 months ago
are you erasing the client area before writing text? if you're drawing text on top of older text, only text directly below your new text is erased. or, try

"Mouse X: %li Y: %li "

as the format string


---
visit #directxdev on afternet

[edited by - indirectx on July 6, 2002 1:03:57 PM]
---visit #directxdev on afternet <- not just for directx, despite the name
quote: Original post by IndirectX
If you knew anything about unicode, you''d have known that in win32 ''W'' stands for WIDE when it''s postfixed to the function name, and it is almost never mentioned in the docs (see ...A/...W macros). a notable exception is CommandLineToArgvW.


True statement. I did, in fact, know that. My confusion entered over the fact that (as I know understand it,) TCHAR is defined as a wide char when UNICODE is defined, else it''s defined as a vanilla char. Therefore, wsprintf does support unicode, it''s just not the default. I certainly made a vile mistake in stating my opinion is fact, and I understand your need to emphatically state what you did. Once again: my bad. Consider this a public apology.

Peace,
ZE.



//email me.//zealouselixir software.//msdn.//n00biez.//
miscellaneous links

[twitter]warrenm[/twitter]

Advertisement
oh yeah, thanks!!! i didn't realize that! it works now!!! thanks a lot!!!

thanks to the other people also here who tried to help me!

EDIT:

btw, last one, ehm, do you guys also output/write your text to the window this way? or is you guys have any other way? just curious of some other ideas,

[edited by - mickey on July 6, 2002 11:53:16 PM]
http://www.dualforcesolutions.comProfessional website designs and development, customized business systems, etc.,
quote: Original post by mickey
btw, last one, ehm, do you guys also output/write your text to the window this way? or is you guys have any other way? just curious of some other ideas,

that's one way of writing text. win32 provides a few others: drawtext, polytextout, plus Ex and Ext versions. visit msdn for them.


---
visit #directxdev on afternet

[edited by - indirectx on July 6, 2002 12:13:13 AM]
---visit #directxdev on afternet <- not just for directx, despite the name
ehm no, i know that,

i mean, like how''d you guys output variables? do you stuffs em up in a char buffer using wsprintf(...)? coz i found it very inefficient using that style, there''s probably a quicker way...,


http://www.dualforcesolutions.comProfessional website designs and development, customized business systems, etc.,
quote: Original post by ZealousElixir

True statement. I did, in fact, know that. My confusion entered over the fact that (as I know understand it,) TCHAR is defined as a wide char when UNICODE is defined, else it''s defined as a vanilla char. Therefore, wsprintf does support unicode, it''s just not the default. I certainly made a vile mistake in stating my opinion is fact, and I understand your need to emphatically state what you did. Once again: my bad. Consider this a public apology.



I read a windows include file once (horrible...). As far as I can remember, when UNICODE is defined, wsprintf is mapped to wsprintfW, otherwise it is mapped to wsprintfA.



----
David Sporn AKA Sporniket
Advertisement
w?sprintf[WA]? is evil...

I cannot conceive of a God who rewards and punishes his creatures, or has a will of the type of which we are conscious in ourselves. An individual who should survive his physical death is also beyond my comprehension, such notions are for the fears or absurd egoism of feeble souls.
Albert Einstein
--AnkhSVN - A Visual Studio .NET Addin for the Subversion version control system.[Project site] [IRC channel] [Blog]
quote: Original post by mickey
ehm no, i know that,

i mean, like how''d you guys output variables? do you stuffs em up in a char buffer using wsprintf(...)? coz i found it very inefficient using that style, there''s probably a quicker way...,




The best way, I found, is to write/obtain a function which will print all the stuff into a buffer and write it out to the desired place (OutputDebugString(), logfile, console, whatever). You write it to take variable arguments, and then use it just like printf(). Better than having buffers everywhere.

Superpig
- saving pigs from untimely fates
- sleeps in a ham-mock at www.thebinaryrefinery.cjb.net

Richard "Superpig" Fine - saving pigs from untimely fates - Microsoft DirectX MVP 2006/2007/2008/2009
"Shaders are not meant to do everything. Of course you can try to use it for everything, but it's like playing football using cabbage." - MickeyMouse

quote: Original post by davidsporn
I read a windows include file once (horrible...). As far as I can remember, when UNICODE is defined, wsprintf is mapped to wsprintfW, otherwise it is mapped to wsprintfA.

my only real grievance against windows include files is the lack of parameter names. good luck trying to figure out what each of the ten consecutive int parameters does. other than that, browse info is very helpful.

quote: Original post by Arild Fines
w?sprintf[WA]? is evil...

i absolutely agree. use the safe string functions, StringCchVPrintf should do.

quote: Original post by mickey
i mean, like how''d you guys output variables? do you stuffs em up in a char buffer using wsprintf(...)? coz i found it very inefficient using that style, there''s probably a quicker way...,

i doubt that sprintf is your real bottleneck. you can use itoa and similar functions for more specific cases (single int->string), but i believe that sprintf provides a good general solution at a very acceptable speed.

---
visit #directxdev on afternet
---visit #directxdev on afternet <- not just for directx, despite the name

This topic is closed to new replies.

Advertisement