Click here to Skip to main content
15,890,882 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: can any one help me to make context menu in win32 API Pin
amitmistry_petlad 6-Feb-07 18:54
amitmistry_petlad 6-Feb-07 18:54 
GeneralRe: can any one help me to make context menu in win32 API Pin
Naveen6-Feb-07 19:03
Naveen6-Feb-07 19:03 
GeneralRe: can any one help me to make context menu in win32 API Pin
amitmistry_petlad 6-Feb-07 19:51
amitmistry_petlad 6-Feb-07 19:51 
QuestionTCHAR Pin
asdtry5-Feb-07 23:16
asdtry5-Feb-07 23:16 
AnswerRe: TCHAR Pin
Michael Dunn5-Feb-07 23:19
sitebuilderMichael Dunn5-Feb-07 23:19 
GeneralRe: TCHAR Pin
asdtry5-Feb-07 23:28
asdtry5-Feb-07 23:28 
GeneralRe: TCHAR Pin
toxcct5-Feb-07 23:38
toxcct5-Feb-07 23:38 
GeneralRe: TCHAR Pin
Waldermort6-Feb-07 0:07
Waldermort6-Feb-07 0:07 
You cannot change the meaning of a TCHAR. When reading files, it would be better for you to create two functions, one to read a unicode file, the other to read an ansi file.
#define _UNICODE
#define UNICODE
#include "tchar.h"  // a TCHAR is now a wchar_t

TCHAR *ReadAnsiFile( TCHAR* szFileName )
{
    // Read the file into a TCHAR array
    
    TCHAR TcharBuffer[ size of the file ];
    OpenFile();
#ifdef UNICODE
    char AnsiBuffer[ size of the file ];
    ReadIntoAnsiBuffer();
    ConvertBufferToUnicode();
#else
    ReadIntoTcharBuffer();
#endif
    Return TcharBuffer;
}

TCHAR *ReadUnicodeFile( TCHAR* szFileName )
{
    // Read the file into a TCHAR array

    TCHAR *TcharBuffer[ size of the file ];
    OpenFile();
#ifdef UNICODE
    wchar_t UnicodeBuffer[ sizeoffile ];
    ReadIntoUnicodeBuffer();
    ConvertToAnsi();
#else
    ReadIntoTcharBuffer();
#endif
    Return TcharBuffer;
}

int main()
{
    TCHAR *ReadFile;
    if ( FileIsUnicode )
        ReadFile = ReadUnicodeFile();
    else
        ReadFile = ReadAnsiFile();
}

AnswerRe: TCHAR Pin
Christian Graus5-Feb-07 23:49
protectorChristian Graus5-Feb-07 23:49 
AnswerRe: TCHAR Pin
ThatsAlok6-Feb-07 19:53
ThatsAlok6-Feb-07 19:53 
Questionprinter driver Pin
shanmugapriy5-Feb-07 23:10
shanmugapriy5-Feb-07 23:10 
QuestionRe: printer driver Pin
Mark Salsbery6-Feb-07 7:56
Mark Salsbery6-Feb-07 7:56 
QuestionFind memory leaks Pin
Kiran Pinjala5-Feb-07 22:28
Kiran Pinjala5-Feb-07 22:28 
AnswerRe: Find memory leaks Pin
Waldermort5-Feb-07 23:01
Waldermort5-Feb-07 23:01 
AnswerRe: Find memory leaks Pin
Roger Stoltz5-Feb-07 23:13
Roger Stoltz5-Feb-07 23:13 
GeneralRe: Find memory leaks Pin
Waldermort5-Feb-07 23:49
Waldermort5-Feb-07 23:49 
GeneralRe: Find memory leaks Pin
David Crow6-Feb-07 3:36
David Crow6-Feb-07 3:36 
AnswerRe: Find memory leaks Pin
Roger Stoltz5-Feb-07 23:16
Roger Stoltz5-Feb-07 23:16 
QuestionRe: Find memory leaks Pin
David Crow6-Feb-07 3:37
David Crow6-Feb-07 3:37 
AnswerRe: Find memory leaks Pin
Hamid_RT6-Feb-07 5:57
Hamid_RT6-Feb-07 5:57 
GeneralRe: Find memory leaks Pin
Kiran Pinjala6-Feb-07 18:09
Kiran Pinjala6-Feb-07 18:09 
GeneralRe: Find memory leaks Pin
Hamid_RT6-Feb-07 19:13
Hamid_RT6-Feb-07 19:13 
GeneralRe: Find memory leaks Pin
Kiran Pinjala6-Feb-07 19:34
Kiran Pinjala6-Feb-07 19:34 
GeneralRe: Find memory leaks Pin
Hamid_RT6-Feb-07 19:49
Hamid_RT6-Feb-07 19:49 
GeneralRe: Find memory leaks Pin
Kiran Pinjala6-Feb-07 19:56
Kiran Pinjala6-Feb-07 19:56 

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.