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. C#
  4. Error :'Proj.frmMain' does not contain a definition for 'Comm1

Error :'Proj.frmMain' does not contain a definition for 'Comm1

Scheduled Pinned Locked Moved C#
helpquestion
6 Posts 4 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.
  • C Offline
    C Offline
    cole23
    wrote on last edited by
    #1

    hi.. how do u solve this prob? 'Proj.frmMain' does not contain a definition for 'Comm1 namespace Proj { public partial class frmMain : Form { private string[] tx_data = new string[14]; private string[] rx_data = new string[10]; public int i; public frmMain() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { } private void label16_Click(object sender, EventArgs e) { } private void label18_Click(object sender, EventArgs e) { } private void button3_Click(object sender, EventArgs e) { } private void textBox1_TextChanged(object sender, EventArgs e) { } private void button1_Click(object sender, EventArgs e) { } private void dataGridView2_CellContentClick(object sender, DataGridViewCellEventArgs e) { } private void txtTxmID1_TextChanged(object sender, EventArgs e) { } private void txtTxmID5_TextChanged(object sender, EventArgs e) { } private void lblRx2_TextChanged(object sender, EventArgs e) { } private void lblRx5_TextChanged(object sender, EventArgs e) { } private void cmdRead_Click(object sender, EventArgs e) { readID; //For i = 1 To 6 // lblRx(i).Caption = rx_data(i + 1) //Next i string OutString = null; string Instring = null; int y = 0; open_port; //If the port is opened... if (Comm1.PortOpen) { //tx_data(0) = "R" //tx_data(1) = "I" //tx_data(2) = "D" //For i = 0 To 2 // Comm1.Output = tx_data(i) //Next i OutString = "RID"; Comm1.Output = OutString; } } private void Comm1_OnComm() { string Instring = null; for (i = 0; i <= 7; i++) { Instring = Comm1.Input; if (Instring == "") { rx_data[i] = "00"; } else { rx_data[i] = System.Conv

    M C 2 Replies Last reply
    0
    • C cole23

      hi.. how do u solve this prob? 'Proj.frmMain' does not contain a definition for 'Comm1 namespace Proj { public partial class frmMain : Form { private string[] tx_data = new string[14]; private string[] rx_data = new string[10]; public int i; public frmMain() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { } private void label16_Click(object sender, EventArgs e) { } private void label18_Click(object sender, EventArgs e) { } private void button3_Click(object sender, EventArgs e) { } private void textBox1_TextChanged(object sender, EventArgs e) { } private void button1_Click(object sender, EventArgs e) { } private void dataGridView2_CellContentClick(object sender, DataGridViewCellEventArgs e) { } private void txtTxmID1_TextChanged(object sender, EventArgs e) { } private void txtTxmID5_TextChanged(object sender, EventArgs e) { } private void lblRx2_TextChanged(object sender, EventArgs e) { } private void lblRx5_TextChanged(object sender, EventArgs e) { } private void cmdRead_Click(object sender, EventArgs e) { readID; //For i = 1 To 6 // lblRx(i).Caption = rx_data(i + 1) //Next i string OutString = null; string Instring = null; int y = 0; open_port; //If the port is opened... if (Comm1.PortOpen) { //tx_data(0) = "R" //tx_data(1) = "I" //tx_data(2) = "D" //For i = 0 To 2 // Comm1.Output = tx_data(i) //Next i OutString = "RID"; Comm1.Output = OutString; } } private void Comm1_OnComm() { string Instring = null; for (i = 0; i <= 7; i++) { Instring = Comm1.Input; if (Instring == "") { rx_data[i] = "00"; } else { rx_data[i] = System.Conv

      M Offline
      M Offline
      mnvkng76
      wrote on last edited by
      #2

      You have to define Comm1. Right now your not telling the Project what or where Comm1 is

      C A 2 Replies Last reply
      0
      • M mnvkng76

        You have to define Comm1. Right now your not telling the Project what or where Comm1 is

        C Offline
        C Offline
        cole23
        wrote on last edited by
        #3

        can u show where am i to define it?? thanks

        C 1 Reply Last reply
        0
        • C cole23

          can u show where am i to define it?? thanks

          C Offline
          C Offline
          Christian Graus
          wrote on last edited by
          #4

          Inside frmMain, from the look of it.

          Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

          1 Reply Last reply
          0
          • C cole23

            hi.. how do u solve this prob? 'Proj.frmMain' does not contain a definition for 'Comm1 namespace Proj { public partial class frmMain : Form { private string[] tx_data = new string[14]; private string[] rx_data = new string[10]; public int i; public frmMain() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { } private void label16_Click(object sender, EventArgs e) { } private void label18_Click(object sender, EventArgs e) { } private void button3_Click(object sender, EventArgs e) { } private void textBox1_TextChanged(object sender, EventArgs e) { } private void button1_Click(object sender, EventArgs e) { } private void dataGridView2_CellContentClick(object sender, DataGridViewCellEventArgs e) { } private void txtTxmID1_TextChanged(object sender, EventArgs e) { } private void txtTxmID5_TextChanged(object sender, EventArgs e) { } private void lblRx2_TextChanged(object sender, EventArgs e) { } private void lblRx5_TextChanged(object sender, EventArgs e) { } private void cmdRead_Click(object sender, EventArgs e) { readID; //For i = 1 To 6 // lblRx(i).Caption = rx_data(i + 1) //Next i string OutString = null; string Instring = null; int y = 0; open_port; //If the port is opened... if (Comm1.PortOpen) { //tx_data(0) = "R" //tx_data(1) = "I" //tx_data(2) = "D" //For i = 0 To 2 // Comm1.Output = tx_data(i) //Next i OutString = "RID"; Comm1.Output = OutString; } } private void Comm1_OnComm() { string Instring = null; for (i = 0; i <= 7; i++) { Instring = Comm1.Input; if (Instring == "") { rx_data[i] = "00"; } else { rx_data[i] = System.Conv

            C Offline
            C Offline
            Christian Graus
            wrote on last edited by
            #5

            Some serious advice. This is the code of a person who needs to buy a beginner book, and work through it, before thinking about any sort of winforms programming.

            Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

            1 Reply Last reply
            0
            • M mnvkng76

              You have to define Comm1. Right now your not telling the Project what or where Comm1 is

              A Offline
              A Offline
              Abdul Sami X
              wrote on last edited by
              #6

              This is simple. You have not defined the Comm1. May be, during start you have defined and later you have commented/deleted it. Otherwise, jut re-define the Comm1.

              Sr. Software Engineer Irevna, India

              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