Hi,
I am a beginner in .NET.
I am creating a new project. At begin I created this project with a form,
then a class."start"
I want to use class "start" as start point for this program. In this class I
wrote:
[STAThread]
static void Main()
{
Application.Run(new start());
}
But I can not build, compile the project, the error is:
The type or namespace name "Application" could not be found
What can I do?
Thanks
Nhan 6 18427
Le, Thanh-Nhan <le*****@freenet.de> wrote: I am a beginner in .NET. I am creating a new project. At begin I created this project with a form, then a class."start" I want to use class "start" as start point for this program. In this class I wrote: [STAThread]
static void Main()
{
Application.Run(new start());
}
But I can not build, compile the project, the error is:
The type or namespace name "Application" could not be found
What can I do?
Make sure you have "using System.Windows.Forms;" in your list of using
directives.
--
Jon Skeet - <sk***@pobox.com> http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
"Le, Thanh-Nhan" <le*****@freenet.de> wrote in message
news:uC**************@TK2MSFTNGP14.phx.gbl... The type or namespace name "Application" could not be found
Application is a member of System.Windows.Forms namespace.
So You need to add
"using System.Windows.Forms;" line at the beginning
or change Your line to
"System.Windows.Forms.Application.Run(new start());"
Additionally You may need to add "System.Windows.Forms.dll" to Your project
references.
RGDS PSG
I have now the line:
using System.Windows.Forms;
then I have the compile error: "The best overloaded method match for
"System.Windows.Forms.Application.Run(System.Windo ws.Forms)" has some
invalid
argument"
OK, I can understand, the object parameter must be a form object, my "start"
class is any form, is only a normal class.
How can I do? Is it possible, to use a normal class (as in java, or VB6) as
start point for a program?
Nhan
"Jon Skeet [C# MVP]" <sk***@pobox.com> schrieb im Newsbeitrag
news:MP************************@msnews.microsoft.c om... Le, Thanh-Nhan <le*****@freenet.de> wrote: I am a beginner in .NET. I am creating a new project. At begin I created this project with a
form, then a class."start" I want to use class "start" as start point for this program. In this
class I wrote: [STAThread]
static void Main()
{
Application.Run(new start());
}
But I can not build, compile the project, the error is:
The type or namespace name "Application" could not be found
What can I do?
Make sure you have "using System.Windows.Forms;" in your list of using directives.
-- Jon Skeet - <sk***@pobox.com> http://www.pobox.com/~skeet If replying to the group, please do not mail me too
Thanks
please see my posting to Jon Skeet
Nhan
"psg" <pg******@ki.net.pl> schrieb im Newsbeitrag
news:cq**********@b177.ki.net.pl... "Le, Thanh-Nhan" <le*****@freenet.de> wrote in message news:uC**************@TK2MSFTNGP14.phx.gbl... The type or namespace name "Application" could not be found Application is a member of System.Windows.Forms namespace. So You need to add "using System.Windows.Forms;" line at the beginning or change Your line to "System.Windows.Forms.Application.Run(new start());"
Additionally You may need to add "System.Windows.Forms.dll" to Your
project references.
RGDS PSG
"Le, Thanh-Nhan" <le*****@freenet.de> wrote in message
news:Os**************@TK2MSFTNGP11.phx.gbl... OK, I can understand, the object parameter must be a form object
Yes one of options is Form.
my "start" class is any form, is only a normal class. How can I do? Is it possible, to use a normal class (as in java, or VB6) as start point for a program?
In a Main function You can Initialize Your "start" class ("start myStart =
new start();") and run its methods or if start() is only a method/function
of current class You can run it through e.g. "start();"
RGDS PSG
OK, thanks.
in Main function (static void Main() ) I call: start app = new start();
then in contructor of class start, I do everything.
"psg" <pg******@ki.net.pl> schrieb im Newsbeitrag
news:cq**********@b177.ki.net.pl... "Le, Thanh-Nhan" <le*****@freenet.de> wrote in message news:Os**************@TK2MSFTNGP11.phx.gbl... OK, I can understand, the object parameter must be a form object
Yes one of options is Form.
my "start" class is any form, is only a normal class. How can I do? Is it possible, to use a normal class (as in java, or VB6) as start point for a program?
In a Main function You can Initialize Your "start" class ("start myStart = new start();") and run its methods or if start() is only a method/function of current class You can run it through e.g. "start();"
RGDS PSG This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Microsoft |
last post by:
I'm trying to display a word document inside a web page, but everytime I do
I get this error:
Error Type:
Microsoft VBScript runtime (0x800A0046)
Permission denied: 'CreateObject'
Does...
|
by: Benjamin Butz |
last post by:
Starting our application I get this error "File or assembly name xxx.dll, or
one of its dependencies, was not found." The filename xxx.dll changes every
start (i.e. eb5mq-ng.dll, akttbvik,dll,...
|
by: Julie |
last post by:
I stumbled across Application from someone else's code, and I can't
find out squat about by searching MS, Google, or Google Groups.
For the most part, this is returning the fully-qualified name...
|
by: Gustavo L. Fabro |
last post by:
Greetings!
I'm testing VS 2005 Beta 2, and I've compiled a program that
runs just fine on my computer (where VS is installed).
I've tried to run this same program on another computer
(after...
|
by: clv |
last post by:
Hello:
I need to rescue the value of a variable type application from a file ".vb",
when making
"j = Application("test")" throws an error to me, if I the same make from a
pagina aspx I do not...
| |
by: Arjen |
last post by:
Hello,
I want to check if an directory exist.
Directory.Exists(Application + "/Uploads/")
I'm doing this inside a asp.net web project in a class file.
Here is the error message.
The name...
|
by: Bob Day |
last post by:
Using vs2003, vb.net
I start a thread, giving it a name before start. Code snippet:
'give each thread a unique name (for later identification)
Trunk_Thread.Name = "Trunk_0_Thread"
' allow...
|
by: Kobee |
last post by:
Hi,
I'm having a few issues adapting to new 2.0 "website" project vs. the
old 1.1 "web application". One of the major issues I'm having is with
the notion of namespaces. Using the old way, I...
|
by: clintonb |
last post by:
I converted a Web Site project to a Web Application project using the
instructions found on this page:
http://webproject.scottgu.com/CSharp/Migration2/Migration2.aspx
One thing I did differently...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
| |
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |