Click here to Skip to main content
14,484,942 members

C / C++ / MFC

 
QuestionHow to convert a CString object to char array in VC++ MFC Pin
Member 439977124-Jan-10 19:17
MemberMember 439977124-Jan-10 19:17 
AnswerRe: How to convert a CString object to char array in VC++ MFC [modified] Pin
Adam Roderick J24-Jan-10 19:23
MemberAdam Roderick J24-Jan-10 19:23 
GeneralRe: How to convert a CString object to char array in VC++ MFC Pin
Cedric Moonen24-Jan-10 20:23
MemberCedric Moonen24-Jan-10 20:23 
GeneralRe: How to convert a CString object to char array in VC++ MFC Pin
Adam Roderick J24-Jan-10 20:59
MemberAdam Roderick J24-Jan-10 20:59 
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
MemberMember 439977124-Jan-10 20:22 
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
MemberMember 439977124-Jan-10 21:31 
Thanks joe for your comments.

i changed code like this to eliminate char array.

CFile pdmFile;
CFile pdmSecFile;

pdmFile.Open(_T("c:\\strucadv15\\Work\\testpdms\\mod\\testpdms.pdm"),CFile::modeRead);
pdmSecFile.Open(_T("c:\\strucadv15\\Work\\testpdms\\mod\\testpdms_changed.pdm"),CFile::modeCreate | CFile::modeReadWrite);


CString strLinee;
totlen = pdmFile.GetLength();
for(int i = 0; i < totlen; i++)
{
    UINT lBytesRead = pdmFile.Read(ch,1);
    if(ch[0] == '\n')
    {
        pdmSecFile.Write(strLinee, strLinee.GetLength());
        strLinee.Empty();
    }
    strLinee.AppendChar(ch[0]);
}
pdmFile.Close();
pdmSecFile.Close();


but still i got the same output like, after every character its appending one NULL

please give me some solution. Smile | :)


Regards,
Jo

hi

GeneralRe: How to convert a CString object to char array in VC++ MFC Pin
Maya_24-Jan-10 22:28
MemberMaya_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
MemberMember 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
MemberMadan Chauhan25-Jan-10 0:32 
Questionquestion hooking virtual table / class functions Pin
nah133724-Jan-10 10:11
Membernah133724-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
Membernah133724-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
Memberkhomeyni24-Jan-10 7:19 
AnswerRe: iterator & operator overloading error Pin
Avi Berger24-Jan-10 7:31
MemberAvi Berger24-Jan-10 7:31 
GeneralRe: iterator & operator overloading error Pin
khomeyni24-Jan-10 7:38
Memberkhomeyni24-Jan-10 7:38 
GeneralRe: iterator & operator overloading error Pin
Avi Berger24-Jan-10 8:29
MemberAvi Berger24-Jan-10 8:29 
GeneralRe: iterator & operator overloading error Pin
khomeyni24-Jan-10 8:35
Memberkhomeyni24-Jan-10 8:35 
GeneralRe: iterator & operator overloading error Pin
khomeyni24-Jan-10 8:51
Memberkhomeyni24-Jan-10 8:51 
GeneralRe: iterator & operator overloading error Pin
Avi Berger24-Jan-10 8:55
MemberAvi Berger24-Jan-10 8:55 
GeneralRe: iterator & operator overloading error Pin
khomeyni24-Jan-10 8:58
Memberkhomeyni24-Jan-10 8:58 

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.