Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / VB.NET / March 2008

Tip: Looking for answers? Try searching our database.

Advanced and basic examples on how to write a DLL

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
kimiraikkonen - 12 Mar 2008 12:05 GMT
Hi,
On the net, there are no much explanatory examples that tells how to
write a DLL using VB.NET. There are a few but completely lack of
teaching ones that isn't useful for me. Also i had some books but none
of them tells how to write a DLL step by step and deeply and i'd like
to know the priciples of class libraries rather than coding in a
regular exe.

So, i'd like to know what and how i should know writing DLL's
functions, properties (what get & set do and their arguments in dll),
interfaces,

The only clue about writing a DLL i had in that thread (Thanks Tom):
http://groups.google.com/group/microsoft.public.dotnet.languages.vb/browse_threa
d/thread/3b2498ad9e00674a/1973fd12aad4b765?hl=en&lnk=st&q=class+library#1973fd12
aad4b765


But i want to extend and figure out what principles and techniques
must be applied further, any and more code samples are greatly
appreciated.

Thanks
Patrice - 12 Mar 2008 12:12 GMT
Do you have a specific problem ? This is really not that different. Get and
Set as well as writing functions , classes etc... are not DLL specific but a
general language feature.

I would suggest reading at least once the whole language specification...

--
Patrice

> Hi,
> On the net, there are no much explanatory examples that tells how to
[quoted text clipped - 16 lines]
>
> Thanks
kimiraikkonen - 12 Mar 2008 12:26 GMT
> Do you have a specific problem ? This is really not that different. Get and
> Set as well as writing functions , classes etc... are not DLL specific but a
[quoted text clipped - 30 lines]
>
> - Show quoted text -

Not to solve an existing problem. Actually, i'm looking an all-in-one
DLL sample that covers all issues (functions, properties get - set and
more i wish to know) to learn what a DLL's anatomy is all about.
rowe_newsgroups - 12 Mar 2008 12:37 GMT
> > Do you have a specific problem ? This is really not that different. Get and
> > Set as well as writing functions , classes etc... are not DLL specific but a
[quoted text clipped - 34 lines]
> DLL sample that covers all issues (functions, properties get - set and
> more i wish to know) to learn what a DLL's anatomy is all about.

A dll is nothing more than a compile group of classes. If you can
write a class, the only thing you need to do is change the build
output to a library (dll) instead of an executable (exe).

Thanks,

Seth Rowe [MVP]
Patrice - 12 Mar 2008 13:04 GMT
> Not to solve an existing problem. Actually, i'm looking an all-in-one
> DLL sample that covers all issues (functions, properties get - set and
> more i wish to know) to learn what a DLL's anatomy is all about.

As said earlier functions, properties etc.. have nothing specific to DLLs.
They are part of the general language specification and can be used the same
way in DLLs and EXEs files.

A DLL is just a way to organize your code (for example so that the same
compiled code can be used from multiple EXEs files) but the code is the same
regardless of wether it is compiled in a DLL or an EXE file...

You could check what features are available around :
http://msdn2.microsoft.com/en-us/library/bbykd75d.aspx

And perhaps once you are familiarized with VB read at least once the whole
spec at :
http://www.microsoft.com/downloads/details.aspx?FamilyID=39de1dd0-f775-40bf-a191
-09f5a95ef500&displaylang=en


--
Patrice
kimiraikkonen - 12 Mar 2008 13:20 GMT
> > Not to solve an existing problem. Actually, i'm looking an all-in-one
> > DLL sample that covers all issues (functions, properties get - set and
[quoted text clipped - 15 lines]
> --
> Patrice

Patrice, i knew a DLL's mission / position (bunch of classes, can be
included also in exe and can be called from an exe by referencing and
importing),  BUT the thing i wish to see is a real and "all-in-one"
class library CODE sample which is in a educational and summarizing
way. BTW, i've downloaded VB version 8 language specification document
because i only have VB 2005 to test and apply.

Thanks anyway.
Patrice - 12 Mar 2008 13:47 GMT
> i wish to see is a real and "all-in-one"
> class library CODE sample which is in a educational and summarizing
> way

Ok sorry. I doubt you'll find this as generally you study language features
one by one rather than all at once.

The reference part also shows short sample code (btu for each feature
separately). For example
http://msdn2.microsoft.com/en-us/library/sect4ck6.aspx shows  a function
sample such as :

Function myFunction(ByVal j As Integer) As Double
   Return 3.87 * j
End Function

--
Patrice
rowe_newsgroups - 12 Mar 2008 14:24 GMT
> the thing i wish to see is a real and "all-in-one"
> class library CODE sample which is in a educational and summarizing
> way.

I'm really confused. A dll can be as simple as the following code:

////////////////////
Public Class Foo

End Class
///////////////////

If compiled as a library, it will give you a .NET dll that can be used
by any .NET application. That's as simple as it can get, the process
isn't complicated.

Even though that answers the question you asked, I seriously doubt it
answers the question you meant to ask. If that's the case, then let me
ask you this:

What exactly do you plan on accomplishing with a dll?

If I know what you are looking for and why, it will give me a chance
to give you a good, helpful answer.

Thanks,

Seth Rowe [MVP]
kimiraikkonen - 12 Mar 2008 14:48 GMT
> > the thing i wish to see is a real and "all-in-one"
> > class library CODE sample which is in a educational and summarizing
[quoted text clipped - 24 lines]
>
> Seth Rowe [MVP]

Seth,
I was just trying to figure out what a dll consists of all about.
Patrice's statement links on MSDN are quite good. Explains a dll's
architecture good. I usually used to code in interaction with design
mode (like double clicking controls and their events, subroutines,
built-in functions etc.) with just one class named Form1 :-)

That's why i wanted to learn and extend coding class libraries
manually like in a dll. That's why i needed to know all the things
between "Public Class Foo" and "End Class" like in your class. I hope
i explained enough clear.

Thanks
kimiraikkonen - 12 Mar 2008 14:50 GMT
> > the thing i wish to see is a real and "all-in-one"
> > class library CODE sample which is in a educational and summarizing
[quoted text clipped - 24 lines]
>
> Seth Rowe [MVP]

For example a good answer to my question:
(Hope to see more)

http://msdn2.microsoft.com/en-us/library/wa0hwf23.aspx
rowe_newsgroups - 12 Mar 2008 15:30 GMT
> > > the thing i wish to see is a real and "all-in-one"
> > > class library CODE sample which is in a educational and summarizing
[quoted text clipped - 29 lines]
>
> http://msdn2.microsoft.com/en-us/library/wa0hwf23.aspx

Yeah, that's basically the language spec that Patrice was talking
about. That isn't specific to a dll, but general to everything written
in Visual Basic.NET. As far as the IDE goes, you still should be able
to use the Form designer, I've written a few dlls that expose forms /
usercontrols and I used the ide to lay out the visual components.
Really all a dll is is just a way of deploying code. Dll's can only be
used by other applications, they basically just contain common code
that you want to distribute to be used by other applications.

Thanks,

Seth Rowe [MVP]
Just_a_fan@home.net - 15 Mar 2008 00:22 GMT
For a nice, working example, look on PSC for KFTP.  It is source for
creating a .dll and a sample program for using it.

It might be a good jumpstart for you.  Good luck and buy a book.  They
are finally out there for VS2008.

Mike

On Wed, 12 Mar 2008 04:05:25 -0700 (PDT), in
microsoft.public.dotnet.languages.vb kimiraikkonen

>Hi,
>On the net, there are no much explanatory examples that tells how to
[quoted text clipped - 16 lines]
>
>Thanks

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.