-
March 6th, 2006, 07:50 AM
#1
CString m_pchData
I´ve a problem with code from VC6
Code:
double Double() const {return atof(m_pchData);}
Now I´ve Visual 2005 and I have no idea about the new syntax . Who can halp me.
-
March 6th, 2006, 07:55 AM
#2
Re: CString m_pchData
What you got there seems OK. What error messages do you get?
- petter
-
March 6th, 2006, 08:03 AM
#3
Re: CString m_pchData
The error message:
error C2065: 'm_pchData': nichtdeklarierter Bezeichner
-
March 6th, 2006, 08:16 AM
#4
Re: CString m_pchData
Did you remember to declare the variable 'm_pchData'?`
It would help if you posted some code? Maybe the whole class?
- petter
-
March 6th, 2006, 09:14 AM
#5
Re: CString m_pchData
Visual Studio 6 declared m_pchData as a protected member of the CString class. Visual Studio .Net uses a template CString class CStringT that does not contain m_pchData. It appears that you are tring to access the character contents that are wrapped by CString. Why not use a function like GetBuffer()?
Gort...Klaatu, Barada Nikto!
-
March 6th, 2006, 09:15 AM
#6
Re: CString m_pchData
You must have derived your class from CString. That I think is completely unnecessary.
You can use CString object as if you were using pointer to a character string or use GetBuffer/GetBufferSetLength to manipulate CString buffer.
Since VS 7 (2002) there is no CString as it were in VS 6.0.
I do not have access to VS other than 6.0 (I am at my customer computer) but you can check how CString is defined in 2005. It is just a typdef that uses template ATL class (ATL::CStringT if I remember correctly).
There are only 10 types of people in the world:
Those who understand binary and those who do not.
-
March 6th, 2006, 09:37 AM
#7
Re: CString m_pchData
Beside Mike and John already said.
Modify your code and use directly CString rather than the derivated class which gives you more troubles than benefits.
For example, that poor CStringDerived::Double function can be easily replaced in your code with atof(someCStringObject);
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|