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

char* into MessageBoxW?


char* into MessageBoxW?

Postby refractor » Aug 14, 2002 @ 4:36pm

This is surely a really stupid question, but I need to do something (like) :

long my_function(char *str)
{
return MessageBox(str,TEXT("HELLO"),MB_OK);
}

Except MessageBoxW expects str to be a Wide and I can't find a conversion function ... or I'm missing something obvious here...?

Cheers,

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


Postby refractor » Aug 14, 2002 @ 4:49pm

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


Postby BurningSheep » Aug 14, 2002 @ 5:14pm

Do you want custom Snails levels? Click
User avatar
BurningSheep
pm Insider
 
Posts: 1226
Joined: Apr 12, 2002 @ 11:49pm
Location: The Netherlands


Postby Hosed » Aug 14, 2002 @ 9:08pm

CStrings are based around the TCHAR as well so when you build functions to accept TCHARs it becomes much easier to use CStrings with them.
L. L. Goodwin<BR>Purveyor of Code<BR><A href="http://www.planettribes.com/hosed/">Hosed's House of Code</A>
User avatar
Hosed
pm Member
 
Posts: 249
Joined: Jan 3, 2002 @ 2:51am
Location: Montana, USA


Postby R0B » Aug 14, 2002 @ 9:20pm

"1011001010 NNNNNNNNNNOOOOOOOOOOOOOOOO!!!!!!" -Bender
User avatar
R0B
got muffins?
 
Posts: 1894
Joined: Jun 22, 2001 @ 12:04pm


Postby Guest » Aug 16, 2002 @ 1:42am

hmm.. _T is exactly the same as TEXT.. if you're so concerned about "shortness" not why simply use L"my string"?

call me pedantic ;)
Guest
 


Postby BurningSheep » Aug 16, 2002 @ 1:49am

L"String" always converts your string to unicode. So it doesn't do the same thing as the _T and TEXT macros do. They leave the string unchanged if unicode isn't used.
Do you want custom Snails levels? Click
User avatar
BurningSheep
pm Insider
 
Posts: 1226
Joined: Apr 12, 2002 @ 11:49pm
Location: The Netherlands


Postby refractor » Aug 16, 2002 @ 11:21am

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


Postby Hosed » Aug 16, 2002 @ 12:35pm

L. L. Goodwin<BR>Purveyor of Code<BR><A href="http://www.planettribes.com/hosed/">Hosed's House of Code</A>
User avatar
Hosed
pm Member
 
Posts: 249
Joined: Jan 3, 2002 @ 2:51am
Location: Montana, USA


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