CString tt;
tt = GetName();
The declaration of
GetName
suggests that it is part of some class that you have created, which holds a string called
m_Name
. But you are trying to call it as a stand-alone function, not as a method of a class. You need an object of your class (fully constructed) before you can use its methods. So your code should most likely be something like:
class MyClass
{
CString m_name;
public:
MyClass(CString name)
{
m_name = name;
}
CString GetName( void ) const {return m_Name;}
};
MyClass thing("Fred");
CString tt;
tt = thing.GetName();