Click here to Skip to main content
15,922,696 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: string or int? Pin
Christian Graus14-Sep-07 4:17
protectorChristian Graus14-Sep-07 4:17 
GeneralRe: string or int? Pin
VonHagNDaz14-Sep-07 4:20
VonHagNDaz14-Sep-07 4:20 
GeneralRe: string or int? Pin
led mike14-Sep-07 4:29
led mike14-Sep-07 4:29 
GeneralRe: string or int? Pin
VonHagNDaz14-Sep-07 4:32
VonHagNDaz14-Sep-07 4:32 
GeneralRe: string or int? Pin
led mike14-Sep-07 4:44
led mike14-Sep-07 4:44 
GeneralRe: string or int? Pin
VonHagNDaz14-Sep-07 4:53
VonHagNDaz14-Sep-07 4:53 
GeneralRe: string or int? Pin
David Crow14-Sep-07 4:23
David Crow14-Sep-07 4:23 
QuestionUnsure of reason for error. Pin
Chris Meech14-Sep-07 4:02
Chris Meech14-Sep-07 4:02 
I have a static library project that was converted from VS6 to VS2005. The project is set to warning level 4 and to treat warnings as errors. All of the .cpp/.h files compile clean and produce the library fine. I recently started a brand spanking new project and in one of the .cpp files for this new project, when I #include one of the headers from the static lib project, the header file generates the following error
d:\projects\reds\tables\tblport.h(18) : error C2440: 'type cast' : cannot convert from 'const CString' to 'LPCSTR'

The offending line of code is
LPCSTR GetAccountNum() const { return (LPCSTR)m_AccountNumber; }

and the class contains a member called, m_AccountNumber which is declared as type CString.

I thought that there was a cast operator for the CString class that would give you a const pointer? It's like it's there in my converted projects, but not there for anything new. Anyone with a idea of what to look for? Thanks.


Chris Meech
I am Canadian. [heard in a local bar]

AnswerRe: Unsure of reason for error. Pin
jhwurmbach14-Sep-07 4:07
jhwurmbach14-Sep-07 4:07 
GeneralRe: Unsure of reason for error. Pin
Chris Meech14-Sep-07 4:40
Chris Meech14-Sep-07 4:40 
GeneralRe: Unsure of reason for error. Pin
jhwurmbach14-Sep-07 4:46
jhwurmbach14-Sep-07 4:46 
AnswerRe: Unsure of reason for error. Pin
Mark Salsbery14-Sep-07 7:04
Mark Salsbery14-Sep-07 7:04 
GeneralRe: Unsure of reason for error. Pin
Chris Meech14-Sep-07 7:29
Chris Meech14-Sep-07 7:29 
Questiondo you think you raelly know the difference of public and private? Pin
includeh1014-Sep-07 3:47
includeh1014-Sep-07 3:47 
QuestionRe: do you think you raelly know the difference of public and private? Pin
Nelek14-Sep-07 4:07
protectorNelek14-Sep-07 4:07 
QuestionRe: do you think you raelly know the difference of public and private? Pin
Maximilien14-Sep-07 4:10
Maximilien14-Sep-07 4:10 
AnswerRe: do you think you raelly know the difference of public and private? Pin
nbugalia14-Sep-07 4:34
nbugalia14-Sep-07 4:34 
AnswerRe: do you think you raelly know the difference of public and private? Pin
Russell'14-Sep-07 7:23
Russell'14-Sep-07 7:23 
GeneralRe: do you think you raelly know the difference of public and private? Pin
Nelek17-Sep-07 19:48
protectorNelek17-Sep-07 19:48 
GeneralRe: do you think you raelly know the difference of public and private? Pin
Russell'17-Sep-07 21:38
Russell'17-Sep-07 21:38 
QuestionGetting the following error Pin
Maynka14-Sep-07 3:11
Maynka14-Sep-07 3:11 
AnswerRe: Getting the following error Pin
jhwurmbach14-Sep-07 3:24
jhwurmbach14-Sep-07 3:24 
QuestionRe: Getting the following error Pin
Mark Salsbery14-Sep-07 7:08
Mark Salsbery14-Sep-07 7:08 
AnswerRe: Getting the following error Pin
David Crow14-Sep-07 9:16
David Crow14-Sep-07 9:16 
AnswerRe: Getting the following error Pin
Hamid_RT14-Sep-07 19:16
Hamid_RT14-Sep-07 19:16 

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.