Click here to Skip to main content
15,904,346 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: can you tell me what is that mean?? PinPopular
David Crow2-May-08 8:22
David Crow2-May-08 8:22 
QuestionRe: can you tell me what is that mean?? Pin
Nelek5-May-08 1:18
protectorNelek5-May-08 1:18 
AnswerRe: can you tell me what is that mean?? Pin
David Crow5-May-08 2:53
David Crow5-May-08 2:53 
GeneralRe: can you tell me what is that mean?? Pin
Nelek5-May-08 3:17
protectorNelek5-May-08 3:17 
QuestionReplacements for IsBadReadPtr and IsBadWritePtr Pin
Blake Miller2-May-08 5:59
Blake Miller2-May-08 5:59 
AnswerRe: Replacements for IsBadReadPtr and IsBadWritePtr Pin
Mike Dimmick2-May-08 7:05
Mike Dimmick2-May-08 7:05 
GeneralRe: Replacements for IsBadReadPtr and IsBadWritePtr Pin
Blake Miller2-May-08 7:18
Blake Miller2-May-08 7:18 
GeneralRe: Replacements for IsBadReadPtr and IsBadWritePtr Pin
Mike Dimmick2-May-08 13:14
Mike Dimmick2-May-08 13:14 
AnswerRe: Replacements for IsBadReadPtr and IsBadWritePtr [modified] Pin
Randor 2-May-08 8:51
professional Randor 2-May-08 8:51 
QuestionUNICODE problem Pin
gabbana2-May-08 2:54
gabbana2-May-08 2:54 
AnswerRe: UNICODE problem Pin
Matthew Faithfull2-May-08 3:40
Matthew Faithfull2-May-08 3:40 
AnswerRe: UNICODE problem Pin
David Crow2-May-08 3:45
David Crow2-May-08 3:45 
GeneralRe: UNICODE problem [modified] Pin
gabbana2-May-08 3:56
gabbana2-May-08 3:56 
GeneralRe: UNICODE problem Pin
David Crow2-May-08 4:24
David Crow2-May-08 4:24 
GeneralRe: UNICODE problem Pin
gabbana2-May-08 4:32
gabbana2-May-08 4:32 
GeneralRe: UNICODE problem Pin
gabbana2-May-08 4:49
gabbana2-May-08 4:49 
QuestionRe: UNICODE problem Pin
David Crow2-May-08 4:56
David Crow2-May-08 4:56 
GeneralRe: UNICODE problem Pin
marcinj2-May-08 9:12
marcinj2-May-08 9:12 
GeneralRe: UNICODE problem Pin
gabbana2-May-08 20:01
gabbana2-May-08 20:01 
GeneralRe: UNICODE problem Pin
marcinj3-May-08 11:44
marcinj3-May-08 11:44 
It actually all depends on the project requirements, but I suppose its better to create projects with UNICODE defined and keep your textual data in unicode format. Prefered in my opinion should be UTF-8 which uses less space.

If you are loading a text file you should somehow know its encoding type. If you are using Notepad to save text in Unicode format then file contains some extra information bytes about actual encoding type - it is easy to see them in binary file view. Some info on actual notepad format encoding can be found here:

http://blogs.msdn.com/michkap/archive/2007/04/22/2239345.aspx[^]

There are some other errors in your code that might be the cause of the errory you describe. For example ftell() return length of the file in bytes..., here is a code I got working quite well:

wchar_t *gg;

FILE *wfile;
wfile = _wfopen(L"c:\\ReadMe.txt",L"r");
fseek(wfile,0,SEEK_END);
int num = ftell(wfile);
fseek(wfile,2,SEEK_SET);

int buffSize = sizeof(wchar_t)*(num/2+1);
gg = (wchar_t*)malloc(buffSize);
memset(gg, 0, buffSize);
fread(gg,sizeof(wchar_t),(num-1)/2,wfile);
fclose(wfile);
QuestionNeed to load a directory without the User seeing it- How? Pin
Larry Mills Sr2-May-08 2:30
Larry Mills Sr2-May-08 2:30 
AnswerRe: Need to load a directory without the User seeing it- How? Pin
Hamid_RT2-May-08 2:40
Hamid_RT2-May-08 2:40 
AnswerRe: Need to load a directory without the User seeing it- How? [modified] Pin
_AnsHUMAN_ 2-May-08 2:41
_AnsHUMAN_ 2-May-08 2:41 
GeneralRe: Need to load a directory without the User seeing it- How? Pin
ThatsAlok5-May-08 0:09
ThatsAlok5-May-08 0:09 
AnswerRe: Need to load a directory without the User seeing it- How? Pin
Rajesh R Subramanian2-May-08 2:55
professionalRajesh R Subramanian2-May-08 2:55 

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.