Click here to Skip to main content
15,896,269 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: How to convert a CString object to char array in VC++ MFC Pin
Joe Woodbury24-Jan-10 19:55
professionalJoe Woodbury24-Jan-10 19:55 
GeneralRe: How to convert a CString object to char array in VC++ MFC Pin
Member 439977124-Jan-10 20:22
Member 439977124-Jan-10 20:22 
Thanks joe Smile | :)

i have one more problem. please check the code below

here pdmFile,pdmSecFile are two CFile objs.

CString strLine;
totlen = pdmFile.GetLength();
for(int i = 0; i < totlen; i++)
{
    UINT lBytesRead = pdmFile.Read(ch,1);
    if(ch[0] == '\n')
    {
        int totl = strLine.GetLength();

        TCHAR* pStr = new TCHAR[strLine.GetLength() + 1];
        lstrcpy(pStr, strLine);

        pdmSecFile.Write(pStr, totl+1);
        delete [] pStr;
        pdmSecFile.Flush();
        strLine.ReleaseBuffer();
        strLine.Empty();
    }
    strLine.AppendChar(ch[0]);
}
pdmFile.Close();
pdmSecFile.Close();



iam trying to read each line from the first file and writing to second file.

i am getting the out put but after every character its printing NULL character. please check the code and give me some solution to get the desired output.

Thanks in advance!

Regards,
jo

hi

GeneralRe: How to convert a CString object to char array in VC++ MFC Pin
Joe Woodbury24-Jan-10 20:35
professionalJoe Woodbury24-Jan-10 20:35 
GeneralRe: How to convert a CString object to char array in VC++ MFC Pin
Member 439977124-Jan-10 21:31
Member 439977124-Jan-10 21:31 
GeneralRe: How to convert a CString object to char array in VC++ MFC Pin
Maya_24-Jan-10 22:28
Maya_24-Jan-10 22:28 
GeneralRe: How to convert a CString object to char array in VC++ MFC Pin
Member 439977125-Jan-10 0:18
Member 439977125-Jan-10 0:18 
GeneralRe: How to convert a CString object to char array in VC++ MFC Pin
Joe Woodbury25-Jan-10 7:42
professionalJoe Woodbury25-Jan-10 7:42 
GeneralRe: How to convert a CString object to char array in VC++ MFC Pin
Joe Woodbury25-Jan-10 7:01
professionalJoe Woodbury25-Jan-10 7:01 
AnswerRe: How to convert a CString object to char array in VC++ MFC Pin
Madan Chauhan25-Jan-10 0:32
Madan Chauhan25-Jan-10 0:32 
Questionquestion hooking virtual table / class functions Pin
nah133724-Jan-10 10:11
nah133724-Jan-10 10:11 
AnswerRe: question hooking virtual table / class functions Pin
Stuart Dootson24-Jan-10 11:54
professionalStuart Dootson24-Jan-10 11:54 
GeneralRe: question hooking virtual table / class functions Pin
nah133724-Jan-10 19:26
nah133724-Jan-10 19:26 
GeneralRe: question hooking virtual table / class functions Pin
Stuart Dootson24-Jan-10 20:40
professionalStuart Dootson24-Jan-10 20:40 
Questioniterator & operator overloading error Pin
khomeyni24-Jan-10 7:19
khomeyni24-Jan-10 7:19 
AnswerRe: iterator & operator overloading error Pin
Avi Berger24-Jan-10 7:31
Avi Berger24-Jan-10 7:31 
GeneralRe: iterator & operator overloading error Pin
khomeyni24-Jan-10 7:38
khomeyni24-Jan-10 7:38 
GeneralRe: iterator & operator overloading error Pin
Avi Berger24-Jan-10 8:29
Avi Berger24-Jan-10 8:29 
GeneralRe: iterator & operator overloading error Pin
khomeyni24-Jan-10 8:35
khomeyni24-Jan-10 8:35 
GeneralRe: iterator & operator overloading error Pin
khomeyni24-Jan-10 8:51
khomeyni24-Jan-10 8:51 
GeneralRe: iterator & operator overloading error Pin
Avi Berger24-Jan-10 8:55
Avi Berger24-Jan-10 8:55 
GeneralRe: iterator & operator overloading error Pin
khomeyni24-Jan-10 8:58
khomeyni24-Jan-10 8:58 
GeneralRe: iterator & operator overloading error Pin
Avi Berger24-Jan-10 9:10
Avi Berger24-Jan-10 9:10 
GeneralRe: iterator & operator overloading error Pin
khomeyni24-Jan-10 9:23
khomeyni24-Jan-10 9:23 
GeneralRe: iterator & operator overloading error Pin
khomeyni24-Jan-10 9:27
khomeyni24-Jan-10 9:27 
GeneralRe: iterator & operator overloading error Pin
Avi Berger24-Jan-10 9:35
Avi Berger24-Jan-10 9:35 

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.