Click here to Skip to main content
15,912,756 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questionuse of "SECTION" within a hook dll ..? Pin
only_jack5-Sep-08 8:54
only_jack5-Sep-08 8:54 
QuestionCWnd not receiving PostMessage Pin
gatwork5-Sep-08 8:05
gatwork5-Sep-08 8:05 
Question[Message Deleted] Pin
hhh5-Sep-08 7:54
hhh5-Sep-08 7:54 
AnswerRe: Design Question Pin
Perspx5-Sep-08 10:17
Perspx5-Sep-08 10:17 
GeneralRe: Design Question Pin
hhh5-Sep-08 22:44
hhh5-Sep-08 22:44 
AnswerRe: Design Question Pin
john john mackey5-Sep-08 12:16
john john mackey5-Sep-08 12:16 
GeneralRe: Design Question Pin
hhh5-Sep-08 22:59
hhh5-Sep-08 22:59 
QuestionString literal expansion Pin
Jim Crafton5-Sep-08 7:44
Jim Crafton5-Sep-08 7:44 
in C++ if i have the following string literal:

"Hello"


The compiler represents this as
{'H', 'e', 'l', 'l', 'o', '\0'}

If I were to expand that out to wide chars, for the special case of a string literal in code, I do not need to call MultiByteToWideChar do I? I can just insert 0s to fill in the gap, so "Hello" becomes:
{'H', '\0', 'e', '\0', 'l', '\0', 'l', '\0', 'o', '\0', '\0', '\0'}


I ask this because with Visual C++ wchar_t is always (so far as I know) a 16bit character, which works very nicely with the rest of the OS since it's Unicode support is built with 16bit code points/characters. On other systems (specifically unix based ones) wchar_t is frequently a 32 bit value which is NOT what I want when dealing with string support. This causes translation issues when you write L"Hello" on those systems, and if you simply leave it as "Hello" (ansi), then the string thinks it needs to translate from ascii to unicode, which is big performance hit. So for string literals I thought I might make a simple class that just expands the ansi string literal to a 16 bit version. Something like :

String s = SL("Hello");


Where String is a unicode UTF16 based string class, and "SL" is a StringLiteral class that just expands out the string literal.

Does this make any sense, or have I twisted my head into a moebius strip over nothing?

¡El diablo está en mis pantalones! ¡Mire, mire!

Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)!

SELECT * FROM User WHERE Clue > 0
0 rows returned

Save an Orange - Use the VCF!
VCF Blog

AnswerRe: String literal expansion Pin
Michael Dunn5-Sep-08 8:07
sitebuilderMichael Dunn5-Sep-08 8:07 
AnswerRe: String literal expansion Pin
Garth J Lancaster5-Sep-08 15:00
professionalGarth J Lancaster5-Sep-08 15:00 
Questionhow to read data from com port Pin
manju23reddy5-Sep-08 7:40
manju23reddy5-Sep-08 7:40 
QuestionVC++ and CRystalReport Pin
kasi145-Sep-08 7:39
kasi145-Sep-08 7:39 
AnswerRe: VC++ and CRystalReport Pin
liquid_6-Sep-08 10:48
liquid_6-Sep-08 10:48 
QuestionThreads Pin
bhanu_85095-Sep-08 3:35
bhanu_85095-Sep-08 3:35 
AnswerRe: Threads Pin
David Crow5-Sep-08 3:53
David Crow5-Sep-08 3:53 
AnswerRe: Threads Pin
JudyL_MD5-Sep-08 4:38
JudyL_MD5-Sep-08 4:38 
GeneralRe: Threads Pin
bhanu_85096-Sep-08 0:12
bhanu_85096-Sep-08 0:12 
GeneralRe: Threads Pin
JudyL_MD6-Sep-08 2:46
JudyL_MD6-Sep-08 2:46 
AnswerRe: Threads Pin
Roger Stoltz5-Sep-08 4:42
Roger Stoltz5-Sep-08 4:42 
QuestionHow can Extract String ? Pin
Le@rner5-Sep-08 2:54
Le@rner5-Sep-08 2:54 
AnswerRe: How can Extract String ? Pin
_AnsHUMAN_ 5-Sep-08 2:57
_AnsHUMAN_ 5-Sep-08 2:57 
GeneralRe: How can Extract String ? Pin
toxcct5-Sep-08 3:07
toxcct5-Sep-08 3:07 
GeneralRe: How can Extract String ? Pin
_AnsHUMAN_ 5-Sep-08 3:20
_AnsHUMAN_ 5-Sep-08 3:20 
GeneralRe: How can Extract String ? Pin
toxcct5-Sep-08 3:37
toxcct5-Sep-08 3:37 
AnswerRe: How can Extract String ? Pin
Michael Dunn5-Sep-08 8:24
sitebuilderMichael Dunn5-Sep-08 8:24 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.