Click here to Skip to main content
16,005,241 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionHow to test a thread handle is valid handle? Pin
Lizp12-Nov-02 21:40
Lizp12-Nov-02 21:40 
AnswerRe: How to test a thread handle is valid handle? Pin
Daniel Turini12-Nov-02 22:06
Daniel Turini12-Nov-02 22:06 
GeneralRe: How to test a thread handle is valid handle? Pin
Lizp12-Nov-02 23:00
Lizp12-Nov-02 23:00 
GeneralRe: How to test a thread handle is valid handle? Pin
Daniel Turini12-Nov-02 23:23
Daniel Turini12-Nov-02 23:23 
GeneralAWARE!! Re: How to test a thread handle is valid handle? Pin
Hugo Hallman16-Nov-02 9:15
Hugo Hallman16-Nov-02 9:15 
GeneralCCriticalSection, CDatabase, CRecordset Pin
zecodela12-Nov-02 21:37
zecodela12-Nov-02 21:37 
GeneralStatusbar update problem Pin
Anonymous12-Nov-02 21:17
Anonymous12-Nov-02 21:17 
Generalproblem with unicode and XML Pin
12-Nov-02 21:04
suss12-Nov-02 21:04 
Hi all,

I am trying to create an XML file (containing Greek characters also) from within Visual C++ 6. The code is listed below:
FILE *v_myfile;
_TCHAR v_fileline[100];
_TCHAR v_filename[100];
swprintf(v_filename, _T("%s"), _T("myfile.xml"));
v_myfile=_wfopen(v_filename, _T("w"));
swprintf(v_fileline, _T("%s"), _T("<?xml version=\"1.0\" encoding=\"UNICODE\" ?>"));
fwrite(v_fileline, sizeof(_TCHAR), wcslen(v_fileline), v_myfile);
swprintf(v_fileline, _T("%s"), _T("<Mytag>some text</Mytag>"));
fwrite(v_fileline, sizeof(_TCHAR), wcslen(v_fileline), v_myfile);
....... similar writes to the file and finally..
fclose(v_myfile);

Well, the file is created and I am able to view it using the notepad. However, when I am trying to open it using Internet Explorer I am getting an error related to an invalid character at position 2, line 1 (at the "<" character).
If I open the file with notepad and then save the file WITHOUT making any changes (notepad automatically suggests that I save it as UNICODE), the Internet Explorer is then able to read the file correctlyWTF | :WTF: .
Before I save it using notepad, the length of the file is 752 bytes. After I save it, the length is 754. I guess that these two bytes make the difference.
Anybody have any idea about what is happening?
also, instead of "UNICODE" at the "<?xml....." line I have tried to put "UTF-8", "UTF-16" without any success.

I thank you in advance,Smile | :)
Christos P.

p.s. I have defined _UNICODE at the project setting.
GeneralRe: problem with unicode and XML Pin
Alois Kraus12-Nov-02 21:47
Alois Kraus12-Nov-02 21:47 
GeneralRe: problem with unicode and XML Pin
Anonymous12-Nov-02 22:47
Anonymous12-Nov-02 22:47 
GeneralRe: problem with unicode and XML Pin
Alois Kraus13-Nov-02 7:06
Alois Kraus13-Nov-02 7:06 
GeneralRe: problem with unicode and XML Pin
Ernesto Perales Soto13-Nov-02 14:03
Ernesto Perales Soto13-Nov-02 14:03 
GeneralCommandBars missing... Pin
Daniel Strigl12-Nov-02 20:38
Daniel Strigl12-Nov-02 20:38 
GeneralInt2Type Generic Programming :: C++ Pin
valikac12-Nov-02 20:34
valikac12-Nov-02 20:34 
GeneralRe: Int2Type Generic Programming :: C++ Pin
Christian Graus12-Nov-02 20:48
protectorChristian Graus12-Nov-02 20:48 
GeneralRe: Int2Type Generic Programming :: C++ Pin
Joaquín M López Muñoz12-Nov-02 21:49
Joaquín M López Muñoz12-Nov-02 21:49 
GeneralRe: Int2Type Generic Programming :: C++ Pin
valikac13-Nov-02 11:11
valikac13-Nov-02 11:11 
GeneralRe: Int2Type Generic Programming :: C++ Pin
Joaquín M López Muñoz13-Nov-02 11:17
Joaquín M López Muñoz13-Nov-02 11:17 
GeneralRe: Int2Type Generic Programming :: C++ Pin
valikac13-Nov-02 11:29
valikac13-Nov-02 11:29 
GeneralRe: Int2Type Generic Programming :: C++ Pin
Joaquín M López Muñoz13-Nov-02 11:44
Joaquín M López Muñoz13-Nov-02 11:44 
GeneralRe: Int2Type Generic Programming :: C++ Pin
valikac13-Nov-02 12:17
valikac13-Nov-02 12:17 
Questionlightweight replacement for std::vector? Pin
Chris Losinger12-Nov-02 20:12
professionalChris Losinger12-Nov-02 20:12 
AnswerRe: lightweight replacement for std::vector? Pin
Joaquín M López Muñoz12-Nov-02 21:28
Joaquín M López Muñoz12-Nov-02 21:28 
GeneralRe: lightweight replacement for std::vector? Pin
Chris Losinger13-Nov-02 5:13
professionalChris Losinger13-Nov-02 5:13 
AnswerRe: lightweight replacement for std::vector? Pin
peterchen12-Nov-02 23:38
peterchen12-Nov-02 23:38 

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.