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. Instantiating Windows Form

Instantiating Windows Form

Scheduled Pinned Locked Moved Managed C++/CLI
question
5 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.
  • J Offline
    J Offline
    John L DeVito
    wrote on last edited by
    #1

    Heyas all, I've added a new form to my project called ExitForm. In the main form of the project I've added #include "ExitForm.h". I'm trying to do the following: void onSomeEvent(object^ sender, EventArgs^ e) { ExitForm^ eForm = gcnew ExitForm(); eForm->ShowDialog(); } I get ExitForm: undeclared identifier Can anyone shed some light on what I'm forgetting to do to make ExitForm visible to other files in the project? Thanks, John

    S 1 Reply Last reply
    0
    • J John L DeVito

      Heyas all, I've added a new form to my project called ExitForm. In the main form of the project I've added #include "ExitForm.h". I'm trying to do the following: void onSomeEvent(object^ sender, EventArgs^ e) { ExitForm^ eForm = gcnew ExitForm(); eForm->ShowDialog(); } I get ExitForm: undeclared identifier Can anyone shed some light on what I'm forgetting to do to make ExitForm visible to other files in the project? Thanks, John

      S Offline
      S Offline
      Saksida Bojan
      wrote on last edited by
      #2

      I don't see any problem with your code. do you have in ExitForm.h: public ref class ExitForm : public System::Windows::Forms::Form or did you define namespace?

      J 1 Reply Last reply
      0
      • S Saksida Bojan

        I don't see any problem with your code. do you have in ExitForm.h: public ref class ExitForm : public System::Windows::Forms::Form or did you define namespace?

        J Offline
        J Offline
        John L DeVito
        wrote on last edited by
        #3

        Yes, the form was created by visual studio, so the namespace is correct, and the form is inherited correctly. This is driving me nuts! Thanks, John

        S 1 Reply Last reply
        0
        • J John L DeVito

          Yes, the form was created by visual studio, so the namespace is correct, and the form is inherited correctly. This is driving me nuts! Thanks, John

          S Offline
          S Offline
          Saksida Bojan
          wrote on last edited by
          #4

          Did you have any syntax problem in ExitForm.h? If no then delete/remove ExitForm.h And Recreate

          J 1 Reply Last reply
          0
          • S Saksida Bojan

            Did you have any syntax problem in ExitForm.h? If no then delete/remove ExitForm.h And Recreate

            J Offline
            J Offline
            John L DeVito
            wrote on last edited by
            #5

            OK, I deleted all files pertaining to my form, and recreated, then deleted all precompiled headers etc. and now it works perfectly. that is rediculous. grrr thanks a ton for your help though :) Thanks, John

            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