473,402 Members | 2,064 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,402 software developers and data experts.

GUI not working

I tried compiling the following source code:

Imports System
Imports System.Windows.Forms

Public Class Form1

Shared Sub Main
Dim f1 As New Form()
End Sub

End Class
I got the following errors:

error BC30466: Namespace or type 'Forms' for the Imports
'System.Windows.Forms' cannot be found.
Imports System.Windows.Forms
~~~~~~~~~~~~~~~~~~~~

error BC30002: Type 'Form' is not defined.
Dim f1 As New Form()
~~~~

I thought my entire stack of libraries was gone, but then when I tried to
compile the following code:

Imports System

Public Class Form1

Shared Sub Main
Console.WriteLine("Hello World")
End Sub

End Class
It compiled and ran perfectly. What have I done wrong? Do I need to change
the syntax of my code or download libraries? Is it that I am not compiling
my code correctly. Please reply soon. Thanks all- Hari.

P.S.
If you wish to reply to me personally (which I discourage), please remove
the x from my e-mail addresses as it only exists to prevent spam.
Nov 21 '05 #1
9 2277
"Hari" <ha***********@yahoo.com> wrote in news:qbudnVgFqoT_7bzcRVn-
rQ@adelphia.com:

error BC30466: Namespace or type 'Forms' for the Imports
'System.Windows.Forms' cannot be found.
Imports System.Windows.Forms


Hmmm, check if you have a reference to System.Windows.Forms.

Maybe your default references are screwed up?

--
Lucas Tam (RE********@rogers.com)
Please delete "REMOVE" from the e-mail address when replying.
http://members.ebay.com/aboutme/coolspot18/
Nov 21 '05 #2
> Hmmm, check if you have a reference to System.Windows.Forms.

Maybe your default references are screwed up?


When I type in:

vbc /r:System.Windows.Forms

I get 2 errors reading:

vbc : Command line error BC2017 : could not find library
'System.Windows.Forms'

vbc: Fatal error BC2000 : compiler initialization failed unexpectedly: The
system cannot find the file specified.
If this means that I do not have the libraries necessary to run a GUI
application, could someone please give me a link to where I can download the
SDK. I have already tried one download through MSDN, but it didn't seem to
work. Thanks all.
Nov 21 '05 #3
On Mon, 16 Aug 2004 23:37:47 -0400, Hari wrote:
Hmmm, check if you have a reference to System.Windows.Forms.

Maybe your default references are screwed up?


When I type in:

vbc /r:System.Windows.Forms

I get 2 errors reading:

vbc : Command line error BC2017 : could not find library
'System.Windows.Forms'

vbc: Fatal error BC2000 : compiler initialization failed unexpectedly: The
system cannot find the file specified.
If this means that I do not have the libraries necessary to run a GUI
application, could someone please give me a link to where I can download the
SDK. I have already tried one download through MSDN, but it didn't seem to
work. Thanks all.


vbc /r:System.Windows.Forms.dll

You have to add the .dll
--
Tom Shelton [MVP]
Nov 21 '05 #4

"Hari" <ha***********@yahoo.com> wrote in message
news:YO********************@adelphia.com...
Hmmm, check if you have a reference to System.Windows.Forms.

Maybe your default references are screwed up?

When I type in:

vbc /r:System.Windows.Forms

------------------------^
here you need to specify the assembly name which is System.Windows.Forms.dll
and which contains the namespace System..Windows.Forms.
here's how you need to specify the command (seperate multiple assemblies
with a comma):
vbc /r:System.dll,System.Windows.Forms.dll test.vb
where test.vb might be something like:

Imports System
Imports System.Windows.Forms

Public Class Form1

Shared Sub Main
Dim f1 As New Form()
f1.Width = 300
f1.Height = 300
f1.ShowDialog()
End Sub

End Class

hope this helps..
Imran.

I get 2 errors reading:

vbc : Command line error BC2017 : could not find library
'System.Windows.Forms'

vbc: Fatal error BC2000 : compiler initialization failed unexpectedly: The
system cannot find the file specified.
If this means that I do not have the libraries necessary to run a GUI
application, could someone please give me a link to where I can download
the
SDK. I have already tried one download through MSDN, but it didn't seem to
work. Thanks all.

Nov 21 '05 #5
"Hari" <ha***********@yahoo.com> wrote in message
news:qb********************@adelphia.com...
I tried compiling the following source code:

Imports System
Imports System.Windows.Forms

Public Class Form1

Shared Sub Main
Dim f1 As New Form()
End Sub

End Class
I got the following errors:

error BC30466: Namespace or type 'Forms' for the Imports
'System.Windows.Forms' cannot be found.
Imports System.Windows.Forms
~~~~~~~~~~~~~~~~~~~~


It sounds as though your project is a console application instead of a
Windows Forms application, and the reference to System.Windows.Forms.dll
never got added for you.

Best Regards,

Andy
Nov 21 '05 #6
> Imports System
Imports System.Windows.Forms

Public Class Form1

Shared Sub Main
Dim f1 As New Form()
f1.Width = 300
f1.Height = 300
f1.ShowDialog()
End Sub

End Class


I typed in that exact code, except I called it Form2 and replaced Class
Form1 with Class Form2. Then I typed the following into the command prompt:

vbc /r:System.dll, System.Windows.Forms.dll Form2.vb

and got:

vbc /r:System.dll, System.Windows.Forms.dll Form2.vb
vbc : Command line error BC2001 : file 'System.Windows.Forms.dll' could not
be found

Now what?
Nov 21 '05 #7
> It sounds as though your project is a console >application instead of a
Windows Forms application, and the reference to >System.Windows.Forms.dll

never got added for you.

If so, how do I get the System.Windows.Forms.dll to get added? I tried the
whole referencing thing, but I didn't seem to work. Thanks.
Nov 21 '05 #8
Hari,

That sounds kinda strange.
do you have that dll - System.Windows.Forms.dll - on your machine?
it should be under %Root%\WINNT\Microsoft.NET\Framework\v1.x.xxxx\ for
windows 2000
or under %Root%\Windows\Microsoft.NET\Framework\v1.x.xxxx\ for windows XP.
Infact, that is where vbc.exe is also located - for the default installation
atleast.

let me know..
Imran.

"Hari" <ha***********@yahoo.com> wrote in message
news:47********************@adelphia.com...
Imports System
Imports System.Windows.Forms

Public Class Form1

Shared Sub Main
Dim f1 As New Form()
f1.Width = 300
f1.Height = 300
f1.ShowDialog()
End Sub

End Class

I typed in that exact code, except I called it Form2 and replaced Class
Form1 with Class Form2. Then I typed the following into the command

prompt:
vbc /r:System.dll, System.Windows.Forms.dll Form2.vb

and got:

vbc /r:System.dll, System.Windows.Forms.dll Form2.vb
vbc : Command line error BC2001 : file 'System.Windows.Forms.dll' could not be found

Now what?

Nov 21 '05 #9
THANKS SO MUCH everyone!

I finally got the whole thing to work. First I took Imran's advice and went
looked for the vbc.exe. I found it in
C:/WINDOWS/Microsoft.NET/Framework/v1.1.4322. Also in this directory I found
System.Windows.Forms.dll. I wondered why the whole thing wasn't working and
I typed in:

vbc /r:System.dll, System.Windows.Forms.dll Form2.vb

and got some errors. Then, I removed the space between the comma and
System.Windows..... so I got

vbc /r:System.dll,System.Windows.Forms.dll Form2.vb

AND IT WORKED. Thanks so much everyone, I really owe it all to you guys.
Once again thank you.
Nov 21 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Mullin Yu | last post by:
hi, i have a web service that has file operations on Windows OS, and there may be a file concurrency issue if only one working directory e.g. c:\working therefore, i want to have a unique sub...
5
by: Martin Heuckeroth | last post by:
Hi We are working on a webservice application and are having some problems with the cookies and/or sessions. We have them working on our intranet but then its not working on the internet. We...
5
by: tshad | last post by:
I have been working with setting my drop boxes to allow double clicking to select an item. It worked fine until I made some changes. I then stripped the page down to the bare essentials to find...
8
by: jojobar | last post by:
Okay, I am trying to do is to test the webresource in 2.0 1. I created a new project with assembly name (and default assembly name) "Office". 2. I added the following to the AssemblyInfo.cs...
2
by: Don | last post by:
I'm having problems with intellisense, autocomplete, etc. suddenly not working in certain classes of a project I'm working on. All the options are set, and it all works fine for most classes, but...
9
by: MSDNAndi | last post by:
Hi, I have a set of simple webservices calls that worked fine using .NET Framework 1.0. I am calling a Java/Apache based webservices, the calling side is not able to supply a proper WSDL. ...
4
by: qbproger | last post by:
I'm developing a plugin for some software. The previous version of the software didn't require a start in directory to be set. This allowed me to leave the working directory to the default in the...
3
by: Jason Huang | last post by:
Hi, In our C# Windows Form application, we are using the SQL Server 2000 as the database server. The Database table MyTable has a field RegistrationDate which represents the Date a client comes...
0
by: WORKING IN FAITH | last post by:
three years I LOVE You Monica More options 1 message - Collapse all WORKING IN FAITH View profile More options Nov 13, 11:29 am three years I LOVE You Monica
3
by: lds | last post by:
On our server we have both applications that have been migrated to use v2.0 of the framework as well as apps that have not yet been migrated and still use 1.1. When I tried to deploy my v2.0 app...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.