A problem
-
I create a windows form apllication, p2pport. My form file name is Dlg.I get some errors. error C2027: use of undefined type 'p2pport::CParams' error C2227: left of '->setValue' must point to class/struct/union/generic type in Dlg.cpp params->setValue("Y", "123"); in my Dlg.h file #include "params.h"; namespace p2pport { using namespace System; ............................... public ref class Dlg : public System::Windows::Forms::Form { CParams* params; } } in my param.h file class CParams{ void setvalue(char* k, char* v); } in my params.cpp void CParams::setValue(char* k, char* v){ ..... return; } Can anybody tell me what's wrong with it? Appreciate your reply. Jane
-
I create a windows form apllication, p2pport. My form file name is Dlg.I get some errors. error C2027: use of undefined type 'p2pport::CParams' error C2227: left of '->setValue' must point to class/struct/union/generic type in Dlg.cpp params->setValue("Y", "123"); in my Dlg.h file #include "params.h"; namespace p2pport { using namespace System; ............................... public ref class Dlg : public System::Windows::Forms::Form { CParams* params; } } in my param.h file class CParams{ void setvalue(char* k, char* v); } in my params.cpp void CParams::setValue(char* k, char* v){ ..... return; } Can anybody tell me what's wrong with it? Appreciate your reply. Jane
minihotto wrote:
Can anybody tell me what's wrong with it?
Jane one of your compiler errors....
minihotto wrote:
error C2027: use of undefined type 'p2pport::CParams'
"use of undefined type" is a beginner level error. Using forums to learn novice programming skills is sub-optimal. I strongly urge you to find some novice level books for programming and learn from them. When you need help understanding something from a book you can post the statement you don't understand in a forum and ask for clarification.
-
I create a windows form apllication, p2pport. My form file name is Dlg.I get some errors. error C2027: use of undefined type 'p2pport::CParams' error C2227: left of '->setValue' must point to class/struct/union/generic type in Dlg.cpp params->setValue("Y", "123"); in my Dlg.h file #include "params.h"; namespace p2pport { using namespace System; ............................... public ref class Dlg : public System::Windows::Forms::Form { CParams* params; } } in my param.h file class CParams{ void setvalue(char* k, char* v); } in my params.cpp void CParams::setValue(char* k, char* v){ ..... return; } Can anybody tell me what's wrong with it? Appreciate your reply. Jane
Jane, please note: 1. C++ and C++/CLI are case-sensitive. 2. C++ and C++/CLI classes are private by default. 3. Your CParams class is not int the p2pport namespace 4. Please use more descriptive subject line. 5. Don't disregard Mike's comments. -- modified at 19:49 Wednesday 7th November, 2007
"We make a living by what we get, we make a life by what we give." --Winston Churchill