473,386 Members | 1,886 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,386 software developers and data experts.

Creating Custom Libraries

I'm coming from C++ programming 5 years ago into VB.NET, so please be
patient with me. In C++, I was able to create a "library" of functions
and procedures that I would commonly use in various projects and
simply "include" them when compiled. In my VB.Net web applications, I
have several functions and methods that I will call on each page, but
I don't want to copy and paste it for each page that uses it. Because
then I may have to change something a dozen times and that is not
manageable. I've searched MSDN and various Usenet groups, but nothing
comes up which means I am probably using the wrong words to describe
the problem. Could someone point me in the right direction? Thanks in
advance...

-A
Nov 20 '05 #1
8 1738
Aaron,

You will probably want to build a class library (File, New, Project, Class
Library). Build your classes with their members here and compile it. Then
you can add that assembly ("library") as a reference to your web application
by right-clicking on Reference and adding. It will come up with a list of
assemblies from the Global Access Cache. Down below it has a button to
browse for an assembly. Find and select your assembly and click OK and you
will see it listed under References in your web application now. Now in
your code-behind classes for your web aspx pages, you can:

Private objMyStuff As New MyAssembly.MyClass

and access all the members just as you would in any other library.

HTH,

Raymond Lewallen

"Aaron" <el*********@yahoo.com> wrote in message
news:a4**************************@posting.google.c om...
I'm coming from C++ programming 5 years ago into VB.NET, so please be
patient with me. In C++, I was able to create a "library" of functions
and procedures that I would commonly use in various projects and
simply "include" them when compiled. In my VB.Net web applications, I
have several functions and methods that I will call on each page, but
I don't want to copy and paste it for each page that uses it. Because
then I may have to change something a dozen times and that is not
manageable. I've searched MSDN and various Usenet groups, but nothing
comes up which means I am probably using the wrong words to describe
the problem. Could someone point me in the right direction? Thanks in
advance...

-A

Nov 20 '05 #2
Aaron,

You will probably want to build a class library (File, New, Project, Class
Library). Build your classes with their members here and compile it. Then
you can add that assembly ("library") as a reference to your web application
by right-clicking on Reference and adding. It will come up with a list of
assemblies from the Global Access Cache. Down below it has a button to
browse for an assembly. Find and select your assembly and click OK and you
will see it listed under References in your web application now. Now in
your code-behind classes for your web aspx pages, you can:

Private objMyStuff As New MyAssembly.MyClass

and access all the members just as you would in any other library.

HTH,

Raymond Lewallen

"Aaron" <el*********@yahoo.com> wrote in message
news:a4**************************@posting.google.c om...
I'm coming from C++ programming 5 years ago into VB.NET, so please be
patient with me. In C++, I was able to create a "library" of functions
and procedures that I would commonly use in various projects and
simply "include" them when compiled. In my VB.Net web applications, I
have several functions and methods that I will call on each page, but
I don't want to copy and paste it for each page that uses it. Because
then I may have to change something a dozen times and that is not
manageable. I've searched MSDN and various Usenet groups, but nothing
comes up which means I am probably using the wrong words to describe
the problem. Could someone point me in the right direction? Thanks in
advance...

-A

Nov 20 '05 #3
Addition to Aaron answer:

For source libraries (non compiled):
Create as many Classes, Modules, or what ever you need
Place your libraries in your personal Library path
When you need to use them add them as a link to you project

For compiled libraries (probably dlls)
Compile your libraries
Place your libraries in your personal Library path
In the Object Browser use customize to add "#includes"
or
in the Solution Explorer window right click References and Add what
ever you wish
WARNING:
Using DLLs probably will allow other people to use your libraries.
Can you answer my question in the thread:
C to VB: meaning of ":" is structures
?
Thanks
Raymond Lewallen wrote:
Aaron,

You will probably want to build a class library (File, New, Project, Class
Library). Build your classes with their members here and compile it. Then
you can add that assembly ("library") as a reference to your web application
by right-clicking on Reference and adding. It will come up with a list of
assemblies from the Global Access Cache. Down below it has a button to
browse for an assembly. Find and select your assembly and click OK and you
will see it listed under References in your web application now. Now in
your code-behind classes for your web aspx pages, you can:

Private objMyStuff As New MyAssembly.MyClass

and access all the members just as you would in any other library.

HTH,

Raymond Lewallen

"Aaron" <el*********@yahoo.com> wrote in message
news:a4**************************@posting.google.c om...
I'm coming from C++ programming 5 years ago into VB.NET, so please be
patient with me. In C++, I was able to create a "library" of functions
and procedures that I would commonly use in various projects and
simply "include" them when compiled. In my VB.Net web applications, I
have several functions and methods that I will call on each page, but
I don't want to copy and paste it for each page that uses it. Because
then I may have to change something a dozen times and that is not
manageable. I've searched MSDN and various Usenet groups, but nothing
comes up which means I am probably using the wrong words to describe
the problem. Could someone point me in the right direction? Thanks in
advance...

-A



Nov 20 '05 #4
Addition to Aaron answer:

For source libraries (non compiled):
Create as many Classes, Modules, or what ever you need
Place your libraries in your personal Library path
When you need to use them add them as a link to you project

For compiled libraries (probably dlls)
Compile your libraries
Place your libraries in your personal Library path
In the Object Browser use customize to add "#includes"
or
in the Solution Explorer window right click References and Add what
ever you wish
WARNING:
Using DLLs probably will allow other people to use your libraries.
Can you answer my question in the thread:
C to VB: meaning of ":" is structures
?
Thanks
Raymond Lewallen wrote:
Aaron,

You will probably want to build a class library (File, New, Project, Class
Library). Build your classes with their members here and compile it. Then
you can add that assembly ("library") as a reference to your web application
by right-clicking on Reference and adding. It will come up with a list of
assemblies from the Global Access Cache. Down below it has a button to
browse for an assembly. Find and select your assembly and click OK and you
will see it listed under References in your web application now. Now in
your code-behind classes for your web aspx pages, you can:

Private objMyStuff As New MyAssembly.MyClass

and access all the members just as you would in any other library.

HTH,

Raymond Lewallen

"Aaron" <el*********@yahoo.com> wrote in message
news:a4**************************@posting.google.c om...
I'm coming from C++ programming 5 years ago into VB.NET, so please be
patient with me. In C++, I was able to create a "library" of functions
and procedures that I would commonly use in various projects and
simply "include" them when compiled. In my VB.Net web applications, I
have several functions and methods that I will call on each page, but
I don't want to copy and paste it for each page that uses it. Because
then I may have to change something a dozen times and that is not
manageable. I've searched MSDN and various Usenet groups, but nothing
comes up which means I am probably using the wrong words to describe
the problem. Could someone point me in the right direction? Thanks in
advance...

-A



Nov 20 '05 #5
In response to the first reply:
I do not have the option to choose "Class Library" when I open a new
project. I am running VS .NET 2003 but a class library isn't on the
list. Is there another option? Or how can I add that feature?

To the second reply:
Where would I find my "personal Library Path" and how do I link to it
within the code? As to your other thread, I don't have an answer for
you... sorry

-A

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 20 '05 #6
In response to the first reply:
I do not have the option to choose "Class Library" when I open a new
project. I am running VS .NET 2003 but a class library isn't on the
list. Is there another option? Or how can I add that feature?

To the second reply:
Where would I find my "personal Library Path" and how do I link to it
within the code? As to your other thread, I don't have an answer for
you... sorry

-A

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 20 '05 #7
Wow, moving from C++ to VB.NET? Brave, very brave. Anyhew, File > New
Project there you can select a Library. Shouldn't have changed for 2k3. You can do the same if you want to add it to your current soluton, right
click on the solution > Add > New Project. One thing to remember, you can't
export functions from managed code, so no nifty API programming, but, you
can create a plugin system using either Interfaces or Late-binding. Not on
your topic, but something to think about if you're used to making libraries
with C++.
My first comment is because I started out in VB6, then moved to VB.NET,
and now am trying to learn some stuff I need to accomplish in unmanaged
code, so C++ is my choice, but, damn there's alot of stuff in there! LOL

Anyhew, hope this helps,
Sueffel

"Aaron Asbra" <el*********@ihatespam.com> wrote in message
news:ep**************@TK2MSFTNGP11.phx.gbl... In response to the first reply:
I do not have the option to choose "Class Library" when I open a new
project. I am running VS .NET 2003 but a class library isn't on the
list. Is there another option? Or how can I add that feature?

To the second reply:
Where would I find my "personal Library Path" and how do I link to it
within the code? As to your other thread, I don't have an answer for
you... sorry

-A

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 20 '05 #8
Wow, moving from C++ to VB.NET? Brave, very brave. Anyhew, File > New
Project there you can select a Library. Shouldn't have changed for 2k3. You can do the same if you want to add it to your current soluton, right
click on the solution > Add > New Project. One thing to remember, you can't
export functions from managed code, so no nifty API programming, but, you
can create a plugin system using either Interfaces or Late-binding. Not on
your topic, but something to think about if you're used to making libraries
with C++.
My first comment is because I started out in VB6, then moved to VB.NET,
and now am trying to learn some stuff I need to accomplish in unmanaged
code, so C++ is my choice, but, damn there's alot of stuff in there! LOL

Anyhew, hope this helps,
Sueffel

"Aaron Asbra" <el*********@ihatespam.com> wrote in message
news:ep**************@TK2MSFTNGP11.phx.gbl... In response to the first reply:
I do not have the option to choose "Class Library" when I open a new
project. I am running VS .NET 2003 but a class library isn't on the
list. Is there another option? Or how can I add that feature?

To the second reply:
Where would I find my "personal Library Path" and how do I link to it
within the code? As to your other thread, I don't have an answer for
you... sorry

-A

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 20 '05 #9

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

Similar topics

2
by: satish | last post by:
Hello all, I have a shared object executable viz. *cable* which I execute as follows : $ ansyscust71 -custom cable -p ANSYSRF **ansyscust71 is a shell script and is a part of a software...
5
by: Carl | last post by:
Hi, I am studying C++ right now. I am interested in creating my own mathematical software. Do you have any suggestions on the libraries or std libraries that I can use to creat very simple graphics...
12
by: Brian Genisio | last post by:
Hi all, I am developing some software, that creates a tree of information. For each node, currently I am overriding the new operator, because it is a requirement that after initialization, no...
0
by: 50295 | last post by:
Hi - I program in C++ but I'm not good with VC++ (yet). I will like to create a custom project for which a specific template or wizard does not exist. Because the program is a console...
2
by: 50295 | last post by:
Hi - I program in C++ but I'm not good with VC++ (yet). I will like to create a custom project for which a specific template or wizard does not exist. Because the program is a console...
0
by: Jeremy | last post by:
Hi There, We've got a few web sites that use the same class libraries as well as a few custom server controls. We of course strong name the class libraries as well as custom server controls and...
4
by: Lenard Gunda | last post by:
Hi! I haved created a rendered custom control, placed it in a class library (DLL), assigned a strong name and installed in the GAC. I also have other utilities, that are in class libraries, and...
8
by: Aaron | last post by:
I'm coming from C++ programming 5 years ago into VB.NET, so please be patient with me. In C++, I was able to create a "library" of functions and procedures that I would commonly use in various...
1
by: Abdo Haji-Ali | last post by:
Previously I used to create user controls if I wanted to use a specific set of controls in multiple pages, however I want to deploy my control in other applications so I thought of creating custom...
3
by: =?Utf-8?B?R2hpc3Rvcw==?= | last post by:
Hi all, We have a N-Tier framework and we now create a Web Site App to wotk with this architecture. I add reference from my libraries in the project and creating page and controls is very...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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...

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.