Click here to Skip to main content
15,887,175 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Answer[Solved]: Conversion of 'CString/Resouce String' to Char* Pin
Priya_Sundar28-Nov-07 22:02
Priya_Sundar28-Nov-07 22:02 
GeneralRe: [Solved]: Conversion of 'CString/Resouce String' to Char* Pin
ThatsAlok28-Nov-07 23:14
ThatsAlok28-Nov-07 23:14 
GeneralRe: [Solved]: Conversion of 'CString/Resouce String' to Char* Pin
Priya_Sundar28-Nov-07 23:28
Priya_Sundar28-Nov-07 23:28 
GeneralRe: [Solved]: Conversion of 'CString/Resouce String' to Char* Pin
ThatsAlok28-Nov-07 23:38
ThatsAlok28-Nov-07 23:38 
GeneralRe: [Solved]: Conversion of 'CString/Resouce String' to Char* Pin
Priya_Sundar29-Nov-07 18:17
Priya_Sundar29-Nov-07 18:17 
GeneralRe: [Solved]: Conversion of 'CString/Resouce String' to Char* Pin
cp987629-Nov-07 1:01
cp987629-Nov-07 1:01 
GeneralRe: [Solved]: Conversion of 'CString/Resouce String' to Char* Pin
David Crow29-Nov-07 3:00
David Crow29-Nov-07 3:00 
QuestionRe: Conversion of 'CString/Resouce String' to Char* Pin
David Crow29-Nov-07 3:04
David Crow29-Nov-07 3:04 
Priya_Sundar wrote:
char* strTagName;


Does this member have to be a char*, or can it be a CString object?

Another solution might be:

struct NAME_INFO
{
    char* strTagName;
    BOOL bAlwaysCreate;
 
    NAME_INFO(int nID, BOOL bCreate)
    {
        CString str;
        str.LoadString(nID);
        strTagName = new char[str.GetLength() + 1];
        strcpy(strTagName, str);
        bAlwaysCreate = bCreate;
    }
};
    
CArray<NAME_INFO*, NAME_INFO*> NamesTable;
 
NamesTable.Add(new NAME_INFO(IDS_PRIYA, true));
NamesTable.Add(new NAME_INFO(IDS_NISHA, true));
NamesTable.Add(new NAME_INFO(IDS_RAM, true));
NamesTable.Add(new NAME_INFO(IDS_RAJ, true));
NamesTable.Add(new NAME_INFO(IDS_RAHUL, true));



"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman

"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne


AnswerRe: Conversion of 'CString/Resouce String' to Char* Pin
Priya_Sundar29-Nov-07 16:51
Priya_Sundar29-Nov-07 16:51 
GeneralRe: Conversion of 'CString/Resouce String' to Char* Pin
David Crow30-Nov-07 2:37
David Crow30-Nov-07 2:37 
QuestionDesign multi forms Pin
wira1guys28-Nov-07 16:35
wira1guys28-Nov-07 16:35 
QuestionRe: Design multi forms Pin
Hamid_RT28-Nov-07 18:46
Hamid_RT28-Nov-07 18:46 
AnswerRe: Design multi forms Pin
wira1guys28-Nov-07 18:53
wira1guys28-Nov-07 18:53 
GeneralRe: Design multi forms Pin
Hamid_RT28-Nov-07 19:25
Hamid_RT28-Nov-07 19:25 
GeneralRe: Design multi forms Pin
wira1guys28-Nov-07 22:58
wira1guys28-Nov-07 22:58 
AnswerRe: Design multi forms Pin
Nelek28-Nov-07 22:15
protectorNelek28-Nov-07 22:15 
QuestionHow to get CF card Serial Number? Pin
Waruna28-Nov-07 11:32
Waruna28-Nov-07 11:32 
AnswerRe: How to get CF card Serial Number? Pin
Nelek28-Nov-07 22:10
protectorNelek28-Nov-07 22:10 
AnswerRe: How to get CF card Serial Number? Pin
JudyL_MD29-Nov-07 4:09
JudyL_MD29-Nov-07 4:09 
QuestionHorizontal scroll for CListBox Pin
Jackson8628-Nov-07 9:24
Jackson8628-Nov-07 9:24 
GeneralRe: Horizontal scroll for CListBox Pin
David Crow14-Mar-08 6:04
David Crow14-Mar-08 6:04 
QuestionHorizontal scroll for CListBox. Pin
Jackson8628-Nov-07 9:17
Jackson8628-Nov-07 9:17 
AnswerRe: Horizontal scroll for CListBox. Pin
David Crow28-Nov-07 10:25
David Crow28-Nov-07 10:25 
AnswerRe: Horizontal scroll for CListBox. Pin
Nelek28-Nov-07 22:10
protectorNelek28-Nov-07 22:10 
Questionhelp regarding graphics in VC++ Pin
paresh_sarjani28-Nov-07 8:38
paresh_sarjani28-Nov-07 8:38 

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.