Click here to Skip to main content
15,921,452 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: linking libs in... Pin
Stephane Rodriguez.23-Oct-02 7:43
Stephane Rodriguez.23-Oct-02 7:43 
GeneralRe: linking libs in... Pin
l a u r e n23-Oct-02 7:51
l a u r e n23-Oct-02 7:51 
GeneralMy dialog based app. don't run on another machine (ActiveX???) Pin
whofmans23-Oct-02 7:37
whofmans23-Oct-02 7:37 
GeneralRe: My dialog based app. don't run on another machine (ActiveX???) Pin
Stephane Rodriguez.23-Oct-02 7:53
Stephane Rodriguez.23-Oct-02 7:53 
GeneralMFC ON_CBN_EDITCHANGE message handler never called! Pin
Daniel Strigl23-Oct-02 7:35
Daniel Strigl23-Oct-02 7:35 
GeneralRe: MFC ON_CBN_EDITCHANGE message handler never called! Pin
valikac23-Oct-02 7:58
valikac23-Oct-02 7:58 
GeneralRe: MFC ON_CBN_EDITCHANGE message handler never called! Pin
Daniel Strigl23-Oct-02 19:59
Daniel Strigl23-Oct-02 19:59 
GeneralANSI --> UNICODE conversion problem! Pin
Daniel Strigl23-Oct-02 7:26
Daniel Strigl23-Oct-02 7:26 
I read some simple chars (1 byte wide) from a file and want to build a string, based on this simple chars.

Sample:

Read 'B'
Read 'ü'
Read 'r'
Read 'o'
--> string: "Büro"

I use the following code:

while (TRUE)
{
    char c = 0;

    // Read character from file

    DWORD dwReadBytes;
        
    if (!ReadFile(m_hFile, &c, sizeof(char), &dwReadBytes, NULL) || 
        dwReadBytes != (DWORD) sizeof(char))
    {
        ErrorMessage(_T("Unerwartetes Dateiende (EOF) in Zeile %d."), m_nCurrentLine); 
	
        return FALSE;
    }

    // Find carriage return?

    if (c == '\n')
    {
        break;
    }

    // Add character to string

    str += CString((TCHAR) c);
}


The problem is the line str += CString((TCHAR) c);.
My system (PocketPC) works with UNICODE and so I have to convert the readed char to a UNICODE char.
I have used TCHAR that I can use the source code on both systems (UNICODE & non UNICODE).

So, the problem is now that when I read some chars like ö. ä, ü, ... the conersion result is a "?".
So, when I should read the string "Büro" the result is "B?ro". It look like, that the conversion failed!

How can I fix that?

Daniel Wink | ;)
---------------------------
Never change a running system!

GeneralRe: ANSI --> UNICODE conversion problem! Pin
l a u r e n23-Oct-02 7:41
l a u r e n23-Oct-02 7:41 
GeneralRe: ANSI --> UNICODE conversion problem! Pin
Daniel Strigl23-Oct-02 8:10
Daniel Strigl23-Oct-02 8:10 
GeneralRe: ANSI --> UNICODE conversion problem! Pin
Stephane Rodriguez.23-Oct-02 7:45
Stephane Rodriguez.23-Oct-02 7:45 
GeneralRe: ANSI --> UNICODE conversion problem! Pin
Daniel Strigl23-Oct-02 8:00
Daniel Strigl23-Oct-02 8:00 
GeneralRe: ANSI --> UNICODE conversion problem! Pin
Michael Dunn23-Oct-02 13:35
sitebuilderMichael Dunn23-Oct-02 13:35 
GeneralRe: ANSI --> UNICODE conversion problem! Pin
Daniel Strigl23-Oct-02 20:10
Daniel Strigl23-Oct-02 20:10 
GeneralPlatform SDK's LoadImage() Pin
Sydney Liles23-Oct-02 7:18
Sydney Liles23-Oct-02 7:18 
GeneralRe: Platform SDK's LoadImage() Pin
Stephane Rodriguez.23-Oct-02 7:49
Stephane Rodriguez.23-Oct-02 7:49 
GeneralRe: Platform SDK's LoadImage() Pin
Sydney Liles23-Oct-02 8:16
Sydney Liles23-Oct-02 8:16 
GeneralRe: Platform SDK's LoadImage() Pin
Stephane Rodriguez.23-Oct-02 8:27
Stephane Rodriguez.23-Oct-02 8:27 
GeneralRe: Platform SDK's LoadImage() Pin
Sydney Liles23-Oct-02 8:43
Sydney Liles23-Oct-02 8:43 
GeneralRe: Platform SDK's LoadImage() Pin
Paul M Watt23-Oct-02 9:49
mentorPaul M Watt23-Oct-02 9:49 
GeneralRe: Platform SDK's LoadImage() Pin
Sydney Liles23-Oct-02 9:56
Sydney Liles23-Oct-02 9:56 
GeneralLinker error, I messed up with my SDK directory Pin
User 665823-Oct-02 7:10
User 665823-Oct-02 7:10 
GeneralRe: Linker error, I messed up with my SDK directory Pin
Stephane Rodriguez.23-Oct-02 7:50
Stephane Rodriguez.23-Oct-02 7:50 
GeneralRe: Linker error, I messed up with my SDK directory Pin
User 665823-Oct-02 8:56
User 665823-Oct-02 8:56 
Generalstring Pin
wong190723-Oct-02 7:02
wong190723-Oct-02 7:02 

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.