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. Partial declaration error in C#.

Partial declaration error in C#.

Scheduled Pinned Locked Moved C#
csharphelpquestionlounge
6 Posts 3 Posters 1 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
    C Coudou
    wrote on last edited by
    #1

    what`s wrong with this? i got an error. Error 1 Missing partial modifier on declaration of type 'Chat.chatc'; another partial declaration of this type exists namespace Chat { //public partial class chatc : Form class chatc { private static Form myForm; static Sys.Sockets.TcpClient myTCP; [DllImport("kernel32.dll")] private static extern void ExitProcess(int a); public static void Main() { thanks.

    to know everything is to know yourself...

    C 1 Reply Last reply
    0
    • C C Coudou

      what`s wrong with this? i got an error. Error 1 Missing partial modifier on declaration of type 'Chat.chatc'; another partial declaration of this type exists namespace Chat { //public partial class chatc : Form class chatc { private static Form myForm; static Sys.Sockets.TcpClient myTCP; [DllImport("kernel32.dll")] private static extern void ExitProcess(int a); public static void Main() { thanks.

      to know everything is to know yourself...

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

      chatc is a form, and therefore the framework creates two files for it, one that contains the designer stuff and one for your code. You commented out the class definition and inserted your own ( which contains an instance of Form for some unknown reason ), but the other class still exists, and so that is the reason for the error. You have two files that reference the class chatc, and only one says it's a partial class.

      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 )

      C 1 Reply Last reply
      0
      • C Christian Graus

        chatc is a form, and therefore the framework creates two files for it, one that contains the designer stuff and one for your code. You commented out the class definition and inserted your own ( which contains an instance of Form for some unknown reason ), but the other class still exists, and so that is the reason for the error. You have two files that reference the class chatc, and only one says it's a partial class.

        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 )

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

        thanks so much. i resolve that error. i forgot that i comment out that one. but after i compile another error appear. Error 2 Program 'C:\Documents and Settings\...\obj\Debug\Chat_client.exe' has more than one entry point defined: 'Chat.chatc.Main()' i just namespace Chat { public partial class chatc : Form // class chatc { private static Form myForm; static Sys.Sockets.TcpClient myTCP; [DllImport("kernel32.dll")] private static extern void ExitProcess(int a); public static void Main()

        to know everything is to know yourself...

        A 1 Reply Last reply
        0
        • C C Coudou

          thanks so much. i resolve that error. i forgot that i comment out that one. but after i compile another error appear. Error 2 Program 'C:\Documents and Settings\...\obj\Debug\Chat_client.exe' has more than one entry point defined: 'Chat.chatc.Main()' i just namespace Chat { public partial class chatc : Form // class chatc { private static Form myForm; static Sys.Sockets.TcpClient myTCP; [DllImport("kernel32.dll")] private static extern void ExitProcess(int a); public static void Main()

          to know everything is to know yourself...

          A Offline
          A Offline
          andre_swnpl
          wrote on last edited by
          #4

          C#Coudou wrote:

          public static void Main()

          I means that you have more than one of these.

          C 2 Replies Last reply
          0
          • A andre_swnpl

            C#Coudou wrote:

            public static void Main()

            I means that you have more than one of these.

            C Offline
            C Offline
            C Coudou
            wrote on last edited by
            #5

            yes. i got it. thanks so much. bonus for this forum. check my speedtest today. click http://www.speedtest.net/result/133365187.png[^]

            to know everything is to know yourself...

            1 Reply Last reply
            0
            • A andre_swnpl

              C#Coudou wrote:

              public static void Main()

              I means that you have more than one of these.

              C Offline
              C Offline
              C Coudou
              wrote on last edited by
              #6

              yes. i got it. thanks. bonus for this forum, check my internet speed. http://www.speedtest.net/result/133365187.png[^]

              to know everything is to know yourself...

              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