loading a new form (windows form application) - vc++ 2005
-
Hi to all, I'm new to vc++ and I've read a bit on how to create a new form and load it (make it appear on screen). But i have this code and its corresponding error and would be glad if someone could point me in the right direction. There's three forms, Form1 (login form) and gymMain a main interface. So what I tried to do is first load the application with gymMain and make its Visible state FALSE, next load Form1 (login) and upon confirmation of input, close Form1 and make gymMain visible. Now I try this with the below code and the erorr is shown below. All help/suggestions appreaciated. regards PS: I'm prety sure I used the header files appropriately but one never knows, ... -------------------------- code for Main application: -------------------------- // GymManager.cpp : main project file. #include "stdafx.h" #include "Form1.h" #include "gymMain.h" #include "NewMember.h" #include "search.h" using namespace GymManager; //using namespace Form1; //using namespace gymMain; //using namespace NewMember; //using namespace search; [STAThreadAttribute] int main(array ^args) { // Enabling Windows XP visual effects before any controls are created Application::EnableVisualStyles(); Application::SetCompatibleTextRenderingDefault(false); // Create the main window and run it Application::Run(gcnew gymMain()); return 0; } ---------------------------------------- code for gymMain: ---------------------------------- #pragma once #include "NewMember.h" #include "Form1.h" using namespace System; using namespace System::ComponentModel; using namespace System::Collections; using namespace System::Windows::Forms; using namespace System::Data; using namespace System::Drawing; using namespace System::Globalization; using namespace GymManager; namespace GymManager { /// /// Summary for gymMain /// /// WARNING: If you change the name of this class, you will need to change the /// 'Resource File Name' property for the managed resource compiler tool /// associated with all .resx files this class depends on. Otherwise, /// the designers will not be able to interact properly with localized /// resources associated with this form. /// // //// code for constructor and object declarations and initializations // #pragma endregion private: System::Void btnNewM_Click(System::Object^ sender, System::EventArgs^ e) { // gymMain::Visible = false; // GymManager::NewMember ^newM = gcnew GymManager::NewMember; // newM->Show(); } private: System::Void gymMain_Lo
-
Hi to all, I'm new to vc++ and I've read a bit on how to create a new form and load it (make it appear on screen). But i have this code and its corresponding error and would be glad if someone could point me in the right direction. There's three forms, Form1 (login form) and gymMain a main interface. So what I tried to do is first load the application with gymMain and make its Visible state FALSE, next load Form1 (login) and upon confirmation of input, close Form1 and make gymMain visible. Now I try this with the below code and the erorr is shown below. All help/suggestions appreaciated. regards PS: I'm prety sure I used the header files appropriately but one never knows, ... -------------------------- code for Main application: -------------------------- // GymManager.cpp : main project file. #include "stdafx.h" #include "Form1.h" #include "gymMain.h" #include "NewMember.h" #include "search.h" using namespace GymManager; //using namespace Form1; //using namespace gymMain; //using namespace NewMember; //using namespace search; [STAThreadAttribute] int main(array ^args) { // Enabling Windows XP visual effects before any controls are created Application::EnableVisualStyles(); Application::SetCompatibleTextRenderingDefault(false); // Create the main window and run it Application::Run(gcnew gymMain()); return 0; } ---------------------------------------- code for gymMain: ---------------------------------- #pragma once #include "NewMember.h" #include "Form1.h" using namespace System; using namespace System::ComponentModel; using namespace System::Collections; using namespace System::Windows::Forms; using namespace System::Data; using namespace System::Drawing; using namespace System::Globalization; using namespace GymManager; namespace GymManager { /// /// Summary for gymMain /// /// WARNING: If you change the name of this class, you will need to change the /// 'Resource File Name' property for the managed resource compiler tool /// associated with all .resx files this class depends on. Otherwise, /// the designers will not be able to interact properly with localized /// resources associated with this form. /// // //// code for constructor and object declarations and initializations // #pragma endregion private: System::Void btnNewM_Click(System::Object^ sender, System::EventArgs^ e) { // gymMain::Visible = false; // GymManager::NewMember ^newM = gcnew GymManager::NewMember; // newM->Show(); } private: System::Void gymMain_Lo
As said earlier
Form1
doesn't seem to member ofGymManager
, which is assumed by you while coding.Prasad Notifier using ATL | Operator new[],delete[][^]