System.Windows.Forms namespace

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Alex

    System.Windows.Forms namespace

    Hi,

    I'm completely new to C#, so here is my question:

    Why my C# program (COM dll which I can call from C++ application)
    cannot see namespace

    System.Windows. Forms..

    When I'm typing in "using System..." after the System. the only "W"
    prompt is Web, so I cannot use in my program something like
    MessageBox.Show ( "blah, blah, blah" );

    Thanks,
    Alex

  • Glenn

    #2
    Re: System.Windows. Forms namespace

    Alex

    Have you referenced System.Windows. Forms dll in VS solution explorer (if
    your using VS of course).

    HTH

    Glenn

    "Alex" <alsim123@hotma il.comwrote in message
    news:1158675184 .714041.158520@ i3g2000cwc.goog legroups.com...
    Hi,
    >
    I'm completely new to C#, so here is my question:
    >
    Why my C# program (COM dll which I can call from C++ application)
    cannot see namespace
    >
    System.Windows. Forms..
    >
    When I'm typing in "using System..." after the System. the only "W"
    prompt is Web, so I cannot use in my program something like
    MessageBox.Show ( "blah, blah, blah" );
    >
    Thanks,
    Alex
    >

    Comment

    • Alex

      #3
      Re: System.Windows. Forms namespace

      Glenn, thanks for the quick answer,

      Yes, I'm writing my project using VS 2005. So currently I have in my
      ..cs file

      using System;
      using System.Runtime. InteropServices ;
      using System.IO;
      using System.Collecti ons.Generic;
      using System.Text;

      with no problem..., but ...System.Windo ws is not available on some
      reason...


      Glenn wrote:
      Alex
      >
      Have you referenced System.Windows. Forms dll in VS solution explorer (if
      your using VS of course).
      >
      HTH
      >
      Glenn
      >
      "Alex" <alsim123@hotma il.comwrote in message
      news:1158675184 .714041.158520@ i3g2000cwc.goog legroups.com...
      Hi,

      I'm completely new to C#, so here is my question:

      Why my C# program (COM dll which I can call from C++ application)
      cannot see namespace

      System.Windows. Forms..

      When I'm typing in "using System..." after the System. the only "W"
      prompt is Web, so I cannot use in my program something like
      MessageBox.Show ( "blah, blah, blah" );

      Thanks,
      Alex

      Comment

      • Alex

        #4
        Re: System.Windows. Forms namespace

        OK, I've figured it myself, I had to go in Project->Add Reference and
        add:
        System.Windows. Forms.... now everything is fine. I just don't
        understand why this namespace was not included in my project
        automatically.. .


        Alex wrote:
        Glenn, thanks for the quick answer,
        >
        Yes, I'm writing my project using VS 2005. So currently I have in my
        .cs file
        >
        using System;
        using System.Runtime. InteropServices ;
        using System.IO;
        using System.Collecti ons.Generic;
        using System.Text;
        >
        with no problem..., but ...System.Windo ws is not available on some
        reason...
        >
        >
        Glenn wrote:
        Alex

        Have you referenced System.Windows. Forms dll in VS solution explorer (if
        your using VS of course).

        HTH

        Glenn

        "Alex" <alsim123@hotma il.comwrote in message
        news:1158675184 .714041.158520@ i3g2000cwc.goog legroups.com...
        Hi,
        >
        I'm completely new to C#, so here is my question:
        >
        Why my C# program (COM dll which I can call from C++ application)
        cannot see namespace
        >
        System.Windows. Forms..
        >
        When I'm typing in "using System..." after the System. the only "W"
        prompt is Web, so I cannot use in my program something like
        MessageBox.Show ( "blah, blah, blah" );
        >
        Thanks,
        Alex
        >

        Comment

        • Lebesgue

          #5
          Re: System.Windows. Forms namespace

          Right click on References in solution explorer and click Add new reference.
          Then choose System.Windows. Forms.dll from the list and you are done.


          "Alex" <alsim123@hotma il.comwrote in message
          news:1158676060 .315016.253140@ m7g2000cwm.goog legroups.com...
          Glenn, thanks for the quick answer,
          >
          Yes, I'm writing my project using VS 2005. So currently I have in my
          .cs file
          >
          using System;
          using System.Runtime. InteropServices ;
          using System.IO;
          using System.Collecti ons.Generic;
          using System.Text;
          >
          with no problem..., but ...System.Windo ws is not available on some
          reason...
          >
          >
          Glenn wrote:
          >Alex
          >>
          >Have you referenced System.Windows. Forms dll in VS solution explorer (if
          >your using VS of course).
          >>
          >HTH
          >>
          >Glenn
          >>
          >"Alex" <alsim123@hotma il.comwrote in message
          >news:115867518 4.714041.158520 @i3g2000cwc.goo glegroups.com.. .
          Hi,
          >
          I'm completely new to C#, so here is my question:
          >
          Why my C# program (COM dll which I can call from C++ application)
          cannot see namespace
          >
          System.Windows. Forms..
          >
          When I'm typing in "using System..." after the System. the only "W"
          prompt is Web, so I cannot use in my program something like
          MessageBox.Show ( "blah, blah, blah" );
          >
          Thanks,
          Alex
          >
          >

          Comment

          • Lebesgue

            #6
            Re: System.Windows. Forms namespace

            It depends on the project template. System.Windows. Forms.dll is referenced
            only when you create a Windows Application project

            "Alex" <alsim123@hotma il.comwrote in message
            news:1158676754 .140689.313480@ i3g2000cwc.goog legroups.com...
            OK, I've figured it myself, I had to go in Project->Add Reference and
            add:
            System.Windows. Forms.... now everything is fine. I just don't
            understand why this namespace was not included in my project
            automatically.. .
            >
            >
            Alex wrote:
            >Glenn, thanks for the quick answer,
            >>
            >Yes, I'm writing my project using VS 2005. So currently I have in my
            >.cs file
            >>
            >using System;
            >using System.Runtime. InteropServices ;
            >using System.IO;
            >using System.Collecti ons.Generic;
            >using System.Text;
            >>
            >with no problem..., but ...System.Windo ws is not available on some
            >reason...
            >>
            >>
            >Glenn wrote:
            Alex
            >
            Have you referenced System.Windows. Forms dll in VS solution explorer
            (if
            your using VS of course).
            >
            HTH
            >
            Glenn
            >
            "Alex" <alsim123@hotma il.comwrote in message
            news:1158675184 .714041.158520@ i3g2000cwc.goog legroups.com...
            Hi,
            >
            I'm completely new to C#, so here is my question:
            >
            Why my C# program (COM dll which I can call from C++ application)
            cannot see namespace
            >
            System.Windows. Forms..
            >
            When I'm typing in "using System..." after the System. the only "W"
            prompt is Web, so I cannot use in my program something like
            MessageBox.Show ( "blah, blah, blah" );
            >
            Thanks,
            Alex
            >
            >

            Comment

            • Jianwei Sun

              #7
              Re: System.Windows. Forms namespace

              Because it's not essential for everybody, not many people want it
              included unless you have an explicit need for that..

              Alex wrote:
              OK, I've figured it myself, I had to go in Project->Add Reference and
              add:
              System.Windows. Forms.... now everything is fine. I just don't
              understand why this namespace was not included in my project
              automatically.. .
              >
              >
              Alex wrote:
              >Glenn, thanks for the quick answer,
              >>
              >Yes, I'm writing my project using VS 2005. So currently I have in my
              >.cs file
              >>
              >using System;
              >using System.Runtime. InteropServices ;
              >using System.IO;
              >using System.Collecti ons.Generic;
              >using System.Text;
              >>
              >with no problem..., but ...System.Windo ws is not available on some
              >reason...
              >>
              >>
              >Glenn wrote:
              >>Alex
              >>>
              >>Have you referenced System.Windows. Forms dll in VS solution explorer (if
              >>your using VS of course).
              >>>
              >>HTH
              >>>
              >>Glenn
              >>>
              >>"Alex" <alsim123@hotma il.comwrote in message
              >>news:11586751 84.714041.15852 0@i3g2000cwc.go oglegroups.com. ..
              >>>Hi,
              >>>>
              >>>I'm completely new to C#, so here is my question:
              >>>>
              >>>Why my C# program (COM dll which I can call from C++ application)
              >>>cannot see namespace
              >>>>
              >>>System.Windo ws.Forms..
              >>>>
              >>>When I'm typing in "using System..." after the System. the only "W"
              >>>prompt is Web, so I cannot use in my program something like
              >>>MessageBox.S how( "blah, blah, blah" );
              >>>>
              >>>Thanks,
              >>>Alex
              >>>>
              >

              Comment

              • Claes Bergefall

                #8
                Re: System.Windows. Forms namespace

                Maybe the MessageBox was just an example, but just in case that's what you
                intend to use:
                Throwing up a MessageBox from inside an inproc COM object will rarely (never
                IMHO) be a good idea.

                /claes

                "Alex" <alsim123@hotma il.comwrote in message
                news:1158675184 .714041.158520@ i3g2000cwc.goog legroups.com...
                Hi,
                >
                I'm completely new to C#, so here is my question:
                >
                Why my C# program (COM dll which I can call from C++ application)
                cannot see namespace
                >
                System.Windows. Forms..
                >
                When I'm typing in "using System..." after the System. the only "W"
                prompt is Web, so I cannot use in my program something like
                MessageBox.Show ( "blah, blah, blah" );
                >
                Thanks,
                Alex
                >

                Comment

                Working...