Partial declaration error in C#.
-
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...
-
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...
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 )
-
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 )
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...
-
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...
C#Coudou wrote:
public static void Main()
I means that you have more than one of these.
-
C#Coudou wrote:
public static void Main()
I means that you have more than one of these.
-
C#Coudou wrote:
public static void Main()
I means that you have more than one of these.