PC Review


Reply
Thread Tools Rate Thread

Creating Custom Libraries

 
 
Aaron
Guest
Posts: n/a
 
      7th Apr 2004
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
 
Reply With Quote
 
 
 
 
Raymond Lewallen
Guest
Posts: n/a
 
      7th Apr 2004
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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



 
Reply With Quote
 
M. Angelo
Guest
Posts: n/a
 
      7th Apr 2004
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" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>
>>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

>
>
>


 
Reply With Quote
 
Aaron Asbra
Guest
Posts: n/a
 
      8th Apr 2004
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!
 
Reply With Quote
 
Sueffel
Guest
Posts: n/a
 
      8th Apr 2004
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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!



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
custom libraries /references =?Utf-8?B?RnJpZWRp?= Microsoft Access VBA Modules 3 19th Aug 2005 02:21 PM
newB ?s on Creating libraries in .NET Hari Microsoft VB .NET 2 18th Aug 2004 08:55 AM
Creating Icon Libraries (.icl) Christopher McKay Microsoft Windows 2000 Developer 0 5th May 2004 05:32 PM
Creating my libraries for PPC and WinCE Zanna Microsoft Dot NET Compact Framework 2 20th Apr 2004 03:32 PM
Creating libraries John Microsoft VB .NET 5 23rd Oct 2003 10:47 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:36 PM.