473,326 Members | 2,134 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,326 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 1732
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: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.