This site is no longer active and is available for archival purposes only. Registration and login is disabled.

Probem with swprintf on x86


Probem with swprintf on x86

Postby fzammetti » Jun 20, 2003 @ 6:52am

...and so I said to Mr. Gates: "$640 billion should be enough for anyone!"
User avatar
fzammetti
pm Insider
 
Posts: 1496
Joined: Jun 4, 2002 @ 6:21pm
Location: Omnytex Technologies


Postby fzammetti » Jun 20, 2003 @ 6:56am

...and so I said to Mr. Gates: "$640 billion should be enough for anyone!"
User avatar
fzammetti
pm Insider
 
Posts: 1496
Joined: Jun 4, 2002 @ 6:21pm
Location: Omnytex Technologies


Postby Guest » Jun 20, 2003 @ 5:13pm

Guest
 


Postby Dan East » Jun 20, 2003 @ 5:19pm

Last edited by Dan East on Jun 20, 2003 @ 5:35pm, edited 1 time in total.
User avatar
Dan East
Site Admin
 
Posts: 5264
Joined: Jan 25, 2001 @ 5:19pm
Location: Virginia, USA


Postby Dan East » Jun 20, 2003 @ 5:31pm

User avatar
Dan East
Site Admin
 
Posts: 5264
Joined: Jan 25, 2001 @ 5:19pm
Location: Virginia, USA


Postby Guest » Jun 20, 2003 @ 7:03pm

Maybe I misread his intention then. I was under the impression that he wanted to write portable code between the PC and the PocketPC so that he wouldn't have to have separate code for each and surround the code in #ifdefs. Using TCHAR arrays and the "tchar" version of the library routines (such as _stprintf) will do this and they are designed exactly for this purpose.

TCHAR outStr[32];

_stprintf(outStr, TEXT("%d"), countdown_seconds);


That code will work on the PocketPC and the PC. No muss - no fuss. That is what I thought he was asking how to do.

Sometimes I find the most difficult part of providing help to people on this site is actually understanding what they are trying to do.
Guest
 


Postby Kzinti » Jun 20, 2003 @ 7:35pm

Kzinti
pm Member
 
Posts: 3238
Joined: Jan 13, 2002 @ 5:23am


Postby fzammetti » Jun 20, 2003 @ 8:43pm

Anonymous was correct in what I was asking...

What I coded last night worked and was simply this:

TCHAR outStr[4];
#ifdef _WIN32_WCE
swprintf(outStr, L"%d", countdown_seconds);
#else
sprintf(outStr, "%d", countdown_seconds);
#endif

I wanted to be able to code it so that I didn't need the #ifdef's. His answer was precisely correct, I just tried it, and was precisely what I was looking for.

As for communication issues, try getting eight months into developing a major project and find out that someone didn't communicate the specs properly for one of the primary screens of the system. That has happened to me, and that's not unique in the industry. If someone misunderstands me here, big f'ing deal, no harm no foul. Other places though, it's, shall we say, somewhat worse?!?
...and so I said to Mr. Gates: "$640 billion should be enough for anyone!"
User avatar
fzammetti
pm Insider
 
Posts: 1496
Joined: Jun 4, 2002 @ 6:21pm
Location: Omnytex Technologies


Postby refractor » Jun 20, 2003 @ 11:31pm

User avatar
refractor
pm Insider
 
Posts: 2304
Joined: Feb 5, 2002 @ 1:12pm
Location: Luxembourg


Postby fzammetti » Jun 21, 2003 @ 12:12am

...and so I said to Mr. Gates: "$640 billion should be enough for anyone!"
User avatar
fzammetti
pm Insider
 
Posts: 1496
Joined: Jun 4, 2002 @ 6:21pm
Location: Omnytex Technologies


Return to Windows Mobile


Sort


Forum Description

A discussion forum for mobile device developers on the Windows Mobile platform. Any platform specific topics are welcome.

Moderators:

Dan East, sponge, Digby, David Horn, Kevin Gelso, RICoder

Forum permissions

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

cron