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. System::Windows::Forms Namespace ??

System::Windows::Forms Namespace ??

Scheduled Pinned Locked Moved Managed C++/CLI
helpc++question
11 Posts 3 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.
  • F Offline
    F Offline
    Fritzables
    wrote on last edited by
    #1

    Hi all, I am writing a console app which will in turn run a windows application then simulate sending keyboard command to the application. I have been able to run the app and get it's handle and all that - every thing here is fine. To issue keyboard command I will have to use the SendKeys::SendWait("%F"); The '%F' simulates the Alt-F to access the menu. Seeing that SendKeys is a member of the System::Windows::Form namespace I have to include this in my code, which I have done like this: #using "System.Windows.Forms.dll" using namespace System::Windows::Forms; When I then compile the code, I get the following errors: : error C3083: 'Windows': the symbol to the left of a '::' must be a type : error C2039: 'Forms' : is not a member of 'System' : error C2871: 'Forms' : a namespace with this name does not exist : error C3083: 'Windows': the symbol to the left of a '::' must be a type : error C3083: 'Forms': the symbol to the left of a '::' must be a type : error C3083: 'SendKeys': the symbol to the left of a '::' must be a type : error C2039: 'SendWait' : is not a member of 'System' : error C3861: 'SendWait': identifier not found So, what have I done wrong and how is this rectified ?? Pete PS: Writing with VC++ 2005

    L G 2 Replies Last reply
    0
    • F Fritzables

      Hi all, I am writing a console app which will in turn run a windows application then simulate sending keyboard command to the application. I have been able to run the app and get it's handle and all that - every thing here is fine. To issue keyboard command I will have to use the SendKeys::SendWait("%F"); The '%F' simulates the Alt-F to access the menu. Seeing that SendKeys is a member of the System::Windows::Form namespace I have to include this in my code, which I have done like this: #using "System.Windows.Forms.dll" using namespace System::Windows::Forms; When I then compile the code, I get the following errors: : error C3083: 'Windows': the symbol to the left of a '::' must be a type : error C2039: 'Forms' : is not a member of 'System' : error C2871: 'Forms' : a namespace with this name does not exist : error C3083: 'Windows': the symbol to the left of a '::' must be a type : error C3083: 'Forms': the symbol to the left of a '::' must be a type : error C3083: 'SendKeys': the symbol to the left of a '::' must be a type : error C2039: 'SendWait' : is not a member of 'System' : error C3861: 'SendWait': identifier not found So, what have I done wrong and how is this rectified ?? Pete PS: Writing with VC++ 2005

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      you don't need to use #using "System.Windows.Forms.dll" yust by adding namespace, you aotomaticly add references

      Fritzables wrote:

      SendKeys::SendWait("%F"); The '%F' simulates the Alt-F to access the menu.

      Dou you men like this: menu1->Text = "&File"; // ALT-F menu2->Text = "&Edit"; // ALT-E menu3->Text = "E&xit"; // ALT-X

      F 1 Reply Last reply
      0
      • L Lost User

        you don't need to use #using "System.Windows.Forms.dll" yust by adding namespace, you aotomaticly add references

        Fritzables wrote:

        SendKeys::SendWait("%F"); The '%F' simulates the Alt-F to access the menu.

        Dou you men like this: menu1->Text = "&File"; // ALT-F menu2->Text = "&Edit"; // ALT-E menu3->Text = "E&xit"; // ALT-X

        F Offline
        F Offline
        Fritzables
        wrote on last edited by
        #3

        Ok..... I have now taken out the line: #using "System.Windows.Forms.dll" And now just using: using namespace System::Windows::Forms; But still when compiling I get the following errors: : error C3083: 'Windows': the symbol to the left of a '::' must be a type : error C2039: 'Forms' : is not a member of 'System' : error C2871: 'Forms' : a namespace with this name does not exist Pete

        1 Reply Last reply
        0
        • F Fritzables

          Hi all, I am writing a console app which will in turn run a windows application then simulate sending keyboard command to the application. I have been able to run the app and get it's handle and all that - every thing here is fine. To issue keyboard command I will have to use the SendKeys::SendWait("%F"); The '%F' simulates the Alt-F to access the menu. Seeing that SendKeys is a member of the System::Windows::Form namespace I have to include this in my code, which I have done like this: #using "System.Windows.Forms.dll" using namespace System::Windows::Forms; When I then compile the code, I get the following errors: : error C3083: 'Windows': the symbol to the left of a '::' must be a type : error C2039: 'Forms' : is not a member of 'System' : error C2871: 'Forms' : a namespace with this name does not exist : error C3083: 'Windows': the symbol to the left of a '::' must be a type : error C3083: 'Forms': the symbol to the left of a '::' must be a type : error C3083: 'SendKeys': the symbol to the left of a '::' must be a type : error C2039: 'SendWait' : is not a member of 'System' : error C3861: 'SendWait': identifier not found So, what have I done wrong and how is this rectified ?? Pete PS: Writing with VC++ 2005

          G Offline
          G Offline
          GirishKB
          wrote on last edited by
          #4

          Have you added a reference to the "System.Windows.Forms.dll" ? If not, reference this dll in your project and then try compiling the code. Hope this might help you. Girish K

          F 1 Reply Last reply
          0
          • G GirishKB

            Have you added a reference to the "System.Windows.Forms.dll" ? If not, reference this dll in your project and then try compiling the code. Hope this might help you. Girish K

            F Offline
            F Offline
            Fritzables
            wrote on last edited by
            #5

            G'Day Girish, Yea, I had that in my original code: #using <System.Windows.Forms.dll> and also had: using namespace System::Windows::Forms; But I was told to take the top line out as the namespace will reference the DLL. But when I compile either way I still get that same error code. Pete

            L G 2 Replies Last reply
            0
            • F Fritzables

              G'Day Girish, Yea, I had that in my original code: #using <System.Windows.Forms.dll> and also had: using namespace System::Windows::Forms; But I was told to take the top line out as the namespace will reference the DLL. But when I compile either way I still get that same error code. Pete

              L Offline
              L Offline
              Lost User
              wrote on last edited by
              #6

              go to menu: Project->(Your Project Name) Properties->Common Properties On the right you will see references And you can click Add Reference. Other oproblem coud be: Under General, look if you have Common Language Runtime Support. As long as you have with /clr Third possible. You can have problem with a code. If so then try to add a comment to all includes. If you have a problem with client, yust to be same make an test project. But this namespace would automaticly be in use

              F 1 Reply Last reply
              0
              • F Fritzables

                G'Day Girish, Yea, I had that in my original code: #using <System.Windows.Forms.dll> and also had: using namespace System::Windows::Forms; But I was told to take the top line out as the namespace will reference the DLL. But when I compile either way I still get that same error code. Pete

                G Offline
                G Offline
                GirishKB
                wrote on last edited by
                #7

                Hi Pete, I am not sure whether you got my query correctly. Try this , Right click on the Project and Choose References. Then Add reference to "System.Windows.Forms.dll". Try to compile your code after you have added this line using namespace System::Windows::Forms; Compile and check if it works. If this does not work, then please post your code snippet.. Thanks & Regards, Girish K

                F 2 Replies Last reply
                0
                • G GirishKB

                  Hi Pete, I am not sure whether you got my query correctly. Try this , Right click on the Project and Choose References. Then Add reference to "System.Windows.Forms.dll". Try to compile your code after you have added this line using namespace System::Windows::Forms; Compile and check if it works. If this does not work, then please post your code snippet.. Thanks & Regards, Girish K

                  F Offline
                  F Offline
                  Fritzables
                  wrote on last edited by
                  #8

                  G'Day Girish, Yep ya right.... thought you meant #using You know us Aussies.... a bit slow :-D Thanks for the tip off and will try again in the morn when I get back to work. Take care mate and have a good one. Pete

                  1 Reply Last reply
                  0
                  • L Lost User

                    go to menu: Project->(Your Project Name) Properties->Common Properties On the right you will see references And you can click Add Reference. Other oproblem coud be: Under General, look if you have Common Language Runtime Support. As long as you have with /clr Third possible. You can have problem with a code. If so then try to add a comment to all includes. If you have a problem with client, yust to be same make an test project. But this namespace would automaticly be in use

                    F Offline
                    F Offline
                    Fritzables
                    wrote on last edited by
                    #9

                    G'Day bsaksida, Have a look at my reply to Girish...... Thanks for the hand on this. Pete

                    1 Reply Last reply
                    0
                    • G GirishKB

                      Hi Pete, I am not sure whether you got my query correctly. Try this , Right click on the Project and Choose References. Then Add reference to "System.Windows.Forms.dll". Try to compile your code after you have added this line using namespace System::Windows::Forms; Compile and check if it works. If this does not work, then please post your code snippet.. Thanks & Regards, Girish K

                      F Offline
                      F Offline
                      Fritzables
                      wrote on last edited by
                      #10

                      Hey Girish, I have just tried your suggestion - and I am back up and running. Thanks again and have a great Xmas. Pete

                      G 1 Reply Last reply
                      0
                      • F Fritzables

                        Hey Girish, I have just tried your suggestion - and I am back up and running. Thanks again and have a great Xmas. Pete

                        G Offline
                        G Offline
                        GirishKB
                        wrote on last edited by
                        #11

                        Great !!! You too have a great X'Mas ...:) Regards, Girish

                        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