473,406 Members | 2,439 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,406 software developers and data experts.

Use Custom Class in another Custom Class

4
I am using VB.net with ASP.net 2.0 and am not using Visual Studio. I use my text editor. I have written a class and wrapped it in a namespace called "MyBulb_NS". I want to import and use that namespace in another namespace that i've written called "MyLamp_NS". I have pasted a code snippet below to show how i import the namespace. MyBulb_NS has been compiled to a dll without errors. When I attempt to compile MyLamp_NS it fails. I have pasted its makefile and error below

I am frustrated that it is so difficult to use a custom class in a different custom class. What needs to be done to get this to work? Please help!


Expand|Select|Wrap|Line Numbers
  1. 'Code snipped from MyLamp.vb
  2.  
  3. Option Explicit
  4.  
  5. Imports System
  6. Imports System.Data
  7. Imports System.Data.OleDB
  8. Imports MyBulb_NS
  9.  
  10. Namespace MyLamp_NS
  11.  
  12. Public Class MyLamp
  13. ...
  14.     private bulb as new MyBulb
  15. ...
  16. End Class
  17.  
  18. End Namespace

makeMyLamp.bat
------------------------------------
set indir=c:\www\components\MyLamp.vb
set outdir=c:\www\bin\MyLampVB.dll
set assemblies=System.dll,System.Data.dll,System.XML.d ll

C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\vbc. exe /t:library /out:%outdir% %indir% /r:%assemblies%
pause



EError from command line
------------------------------------------------
c:\www\components\MyLamp.vb(7) : warning BC40056: Namesp
ace or type specified in the Imports 'MyBulb_NS' doesn't contain any public
member or cannot be found. Make sure the namespace or the type is defined and c
ontains at least one public member. Make sure the imported element name doesn't
use any aliases.

Imports MyBulb_NS
Jun 30 '09 #1
7 3151
Curtis Rutland
3,256 Expert 2GB
I wish I could help you, but I always use Visual Studio.

Is there some reason you can't use VS? There are free editions that could be of great use to you.

http://www.microsoft.com/express/download/
Jul 1 '09 #2
c4tech
4
The project manager does not want to use VS b/c he does not like the generated html that it creates.

Also, I use ubuntu and it is easier to write in my text editor and not bother with loading Windows in Virtual Box

Thanks
Jul 1 '09 #3
Frinavale
9,735 Expert Mod 8TB
@c4tech
Then remove the generated HTML...

Wait a second, you're trying to compile a VB.NET application on Ubuntu?!
I'm sorry to tell you this but the .NET Framework is not available in Linux unless you're using something like Mono or Wine...what are you using?
Jul 1 '09 #4
c4tech
4
It's not my decision to remove the generated HTML.

I code using ubuntu, but upload to a Windows server with IIS 6 and ASP.NET 2.0

Thanks
Jul 1 '09 #5
Frinavale
9,735 Expert Mod 8TB
@c4tech
As a developer, you can always chose to remove the HTML generated by Visual Studio.

Visual Studio doesn't really generate a lot of code, it only generates a basic HTML page lay out for you. However, the .NET Server Controls that you use in ASPX pages (like Panel, CheckBox, CheckBoxList, ListBox, GridView, etc) will generate HTML (this is not Visual Studio's fault). Is this what he doesn't like? (because I can completely understand why he wouldn't like this..I too have a particular disgust for what's generated.) In that case you really should be considering a different technology completely. There is MVC ASP.NET that is pretty nice and lets get around the Server Controls...

Anyways, since it's unlikely that you're going to switch technologies at this point, let's take a look at what's going on here.


The first thing that I'd look into is the member definitions for your MyLamp class.

According to what you've posted, it's a public class with private members only. You need some Public Properties or Subs/Functions in order to actually use this class. That's what the compiler's complaining about......
Jul 1 '09 #6
c4tech
4
As it turns out i had to add the following to my makefile in order for /r to know where to find my custom dll's

/libpath:"c:\www\bin"
Jul 6 '09 #7
Frinavale
9,735 Expert Mod 8TB
Thanks for sharing the solution :)
Jul 6 '09 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Christian H | last post by:
Hi! I've created a custom control (myDrawControl) that deals with drawing. This control is then added to a form( myMainForm) Now, whenever something is dragged and dropped onto myDrawControl ,...
7
by: Ken Allen | last post by:
I have a .net client/server application using remoting, and I cannot get the custom exception class to pass from the server to the client. The custom exception is derived from ApplicationException...
3
by: Joe Bloggs | last post by:
Does anyone know if its possible to pass parameters or the values of Request.QueryString from a web page to a custom control class? I'm using a C# Web Application. For Example I have Web Page1...
5
by: Graham | last post by:
I have created a custom MembershipProvider called "LassieMembershipProvider" that derives from "MembershipProvider". This providor is located in a Businesslogic layer dll called...
6
by: Steve Amey | last post by:
Hi all I want to be able to throw a custom error up the call stack. I have looked around and it seems as though it's possible, but I can't get it to work :o( Below is some sample code. ...
12
by: Noel | last post by:
Hello, I'm currently developing a web service that retrieves data from an employee table. I would like to send and retrieve a custom employee class to/from the webservice. I have currently coded...
7
by: John Grandy | last post by:
My ASP.NET Web Service project has a Web Method that returns an array filled with instances of a custom class. The custom class is defined in a Class Library that is included in the web-service...
19
by: Jamey Shuemaker | last post by:
I'm in the process of expanding my knowledge and use of Class Modules. I've perused MSDN and this and other sites, and I'm pretty comfortable with my understanding of Class Modules with the...
1
by: Gene | last post by:
I would like to know if the following is even possible with the visual studio.net Setup and Deployment project. 1. During the deployment after creation of application directory the setup needs...
15
by: rizwanahmed24 | last post by:
Hello i have made a custom control. i have placed a panel on it. I want this panel to behave just like the normal panel. The problem i was having is that the panel on my custom control doesnt...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
agi2029
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 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.