Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Managed C++/CLI
  4. loading a new form (windows form application) - vc++ 2005

loading a new form (windows form application) - vc++ 2005

Scheduled Pinned Locked Moved Managed C++/CLI
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    luhfluh
    wrote on last edited by
    #1

    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

    P 1 Reply Last reply
    0
    • L luhfluh

      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

      P Offline
      P Offline
      prasad_som
      wrote on last edited by
      #2

      As said earlier Form1 doesn't seem to member of GymManager, which is assumed by you while coding.

      Prasad Notifier using ATL | Operator new[],delete[][^]

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups