Click here to Skip to main content
15,920,503 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: "Edit" part of MFC menu. Pin
Hamid_RT21-Jun-06 19:35
Hamid_RT21-Jun-06 19:35 
QuestionOwnerdraw CProgressCtrl with XP Themes Pin
madmax000121-Jun-06 8:47
madmax000121-Jun-06 8:47 
AnswerRe: Ownerdraw CProgressCtrl with XP Themes Pin
Michael Dunn21-Jun-06 8:54
sitebuilderMichael Dunn21-Jun-06 8:54 
GeneralRe: Ownerdraw CProgressCtrl with XP Themes Pin
madmax000121-Jun-06 9:09
madmax000121-Jun-06 9:09 
GeneralRe: Ownerdraw CProgressCtrl with XP Themes Pin
Michael Dunn21-Jun-06 13:51
sitebuilderMichael Dunn21-Jun-06 13:51 
GeneralRe: Ownerdraw CProgressCtrl with XP Themes Pin
madmax000121-Jun-06 22:06
madmax000121-Jun-06 22:06 
GeneralRe: Ownerdraw CProgressCtrl with XP Themes Pin
Michael Dunn22-Jun-06 8:04
sitebuilderMichael Dunn22-Jun-06 8:04 
QuestionCstring to char * error Pin
kitty521-Jun-06 8:07
kitty521-Jun-06 8:07 
I've tried this:
CString str = "0x1";
char *ps;
ps = str.GetBuffer(4);
str.ReleaseBuffer();

// Check if the string starts with a '0x'
if(nStringSize > 2 && ('0' == string[0]) && (('x' == string[1]) || ('X' == string[1])))
{
for(i = 2; i < nStringSize; i++)
{
cReturn = cReturn*16;
// Decode ASCII
if((string[i] >= '0') && (string[i] <= '9'))
cReturn += string[i] - '0';
else if((string[i] >= 'A') && (string[i] <= 'F'))
cReturn += string[i] - 'A' + 0xa;
else if((string[i] >= 'a') && (string[i] <= 'f'))
cReturn += string[i] - 'a' + 0xa;
else
// Incorrect character
return 0;
}
return cReturn;
}
else return atol(string);

I get the following error:
error C2440: '=' cannot convert 'wchar_t*' to 'char*'

I've also tried many other ways to convert CString to char* but I still get errors...

Kitty5
AnswerRe: Cstring to char * error Pin
Michael Dunn21-Jun-06 8:51
sitebuilderMichael Dunn21-Jun-06 8:51 
GeneralRe: Cstring to char * error Pin
kitty521-Jun-06 9:28
kitty521-Jun-06 9:28 
GeneralRe: Cstring to char * error Pin
Zac Howland21-Jun-06 9:35
Zac Howland21-Jun-06 9:35 
QuestionRe: Cstring to char * error Pin
David Crow21-Jun-06 9:38
David Crow21-Jun-06 9:38 
AnswerRe: Cstring to char * error Pin
Zac Howland21-Jun-06 13:20
Zac Howland21-Jun-06 13:20 
QuestionRe: Cstring to char * error Pin
David Crow22-Jun-06 2:33
David Crow22-Jun-06 2:33 
AnswerRe: Cstring to char * error Pin
Zac Howland22-Jun-06 3:20
Zac Howland22-Jun-06 3:20 
GeneralRe: Cstring to char * error Pin
David Crow22-Jun-06 3:35
David Crow22-Jun-06 3:35 
GeneralRe: Cstring to char * error Pin
Zac Howland22-Jun-06 3:39
Zac Howland22-Jun-06 3:39 
GeneralRe: Cstring to char * error Pin
kitty521-Jun-06 9:52
kitty521-Jun-06 9:52 
GeneralRe: Cstring to char * error Pin
David Crow21-Jun-06 10:15
David Crow21-Jun-06 10:15 
QuestionRe: Cstring to char * error Pin
David Crow21-Jun-06 9:36
David Crow21-Jun-06 9:36 
AnswerRe: Cstring to char * error Pin
kitty521-Jun-06 9:50
kitty521-Jun-06 9:50 
GeneralRe: Cstring to char * error Pin
David Crow21-Jun-06 10:16
David Crow21-Jun-06 10:16 
GeneralRe: Cstring to char * error Pin
Zac Howland21-Jun-06 13:23
Zac Howland21-Jun-06 13:23 
QuestionRe: Cstring to char * error Pin
David Crow21-Jun-06 9:12
David Crow21-Jun-06 9:12 
AnswerRe: Cstring to char * error [modified] Pin
kitty521-Jun-06 9:29
kitty521-Jun-06 9:29 

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.