Click here to Skip to main content
16,008,010 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Any ideas on reducing link times? Pin
Anders Molin17-May-01 23:57
professionalAnders Molin17-May-01 23:57 
GeneralRe: Any ideas on reducing link times? Pin
Gerry18-May-01 3:30
Gerry18-May-01 3:30 
GeneralRe: Any ideas on reducing link times? Pin
18-May-01 4:52
suss18-May-01 4:52 
GeneralPrinting under MFC - ARGH !!! Pin
Christian Graus17-May-01 14:57
protectorChristian Graus17-May-01 14:57 
GeneralRe: Printing under MFC - ARGH !!! Pin
l a u r e n18-May-01 12:51
l a u r e n18-May-01 12:51 
GeneralRe: Printing under MFC - ARGH !!! Pin
Christian Graus18-May-01 12:59
protectorChristian Graus18-May-01 12:59 
GeneralRe: Printing under MFC - ARGH !!! Pin
CodeGuy18-May-01 16:50
CodeGuy18-May-01 16:50 
GeneralUnicode File I/O Pin
Shankar Chandra Bose17-May-01 14:35
Shankar Chandra Bose17-May-01 14:35 
I've been trying to use std::wifstream to read a unicode file, like so (in a project with UNICODE on):

std::wifstream wf;
wchar_t wch;
wf.open("unicode.txt");

while(wf.get(wch))
{
std::wcout << wch;
}
wf.close();


Funny thing is, this *still* reads the file byte by byte, NOT wchar_t by wchar_t. This means that if you had a 000D in the file, you'd get a 00 followed by a 0D, NOT a 0D as you'd expect. On the other hand, using the C style FILE* does work properly, as:

FILE* fp = _wfopen(L"unicode.txt", L"r+b");
wchar_t wch;
while(!feof(fp))
{
wch = fgetwc(fp);
std::wcout << wch;
}
fcloseall();

The above code accomplishes what I want. However, as I am not too keen on using just C or Win32 functions, can someone shed somelight on what's going on?

Thanks in advance,

Shanker.
GeneralRe: Unicode File I/O Pin
l a u r e n18-May-01 12:53
l a u r e n18-May-01 12:53 
GeneralCRecordset and SQL Server 2000 Pin
SuperGeek17-May-01 11:15
SuperGeek17-May-01 11:15 
GeneralRe: CRecordset and SQL Server 2000 Pin
4-Sep-01 1:27
suss4-Sep-01 1:27 
GeneralCFormView Throwing Exception Pin
Christopher17-May-01 10:45
Christopher17-May-01 10:45 
GeneralEjecting a CD Pin
17-May-01 8:53
suss17-May-01 8:53 
GeneralRe: Ejecting a CD Pin
Ed Dixon17-May-01 9:21
Ed Dixon17-May-01 9:21 
GeneralRe: Ejecting a CD Pin
Tomasz Sowinski17-May-01 9:28
Tomasz Sowinski17-May-01 9:28 
GeneralRe: Ejecting a CD Pin
17-May-01 18:11
suss17-May-01 18:11 
GeneralRe: Ejecting a CD Pin
Anders Molin17-May-01 23:54
professionalAnders Molin17-May-01 23:54 
GeneralRe: Ejecting a CD Pin
18-May-01 4:01
suss18-May-01 4:01 
GeneralRe: Ejecting a CD Pin
Carlos Antollini17-May-01 9:49
Carlos Antollini17-May-01 9:49 
QuestionHow to make an output file in VC++ Pin
mr200317-May-01 8:49
mr200317-May-01 8:49 
AnswerRe: How to make an output file in VC++ Pin
Ravi Bhavnani17-May-01 10:08
professionalRavi Bhavnani17-May-01 10:08 
GeneralDynamic creation of objects Pin
Luis Barreira17-May-01 7:57
Luis Barreira17-May-01 7:57 
GeneralRe: Dynamic creation of objects Pin
Chris Losinger17-May-01 8:11
professionalChris Losinger17-May-01 8:11 
GeneralRe: Dynamic creation of objects Pin
MikeG18-May-01 3:12
MikeG18-May-01 3:12 
GeneralRe: Dynamic creation of objects Pin
Tomasz Sowinski18-May-01 3:21
Tomasz Sowinski18-May-01 3:21 

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.