Welcome to Dream.In.Code
Become a VB Expert!

Join 149,952 VB Programmers for FREE! Get instant access to thousands of VB experts, tutorials, code snippets, and more! There are 1,328 people online right now. Registration is fast and FREE... Join Now!




Creating a VB 6 DLL

 
Reply to this topicStart new topic

Creating a VB 6 DLL

Fonz
21 Dec, 2007 - 02:33 PM
Post #1

New D.I.C Head
*

Joined: 21 Dec, 2007
Posts: 2

Can anyone tell me if what is the difference between creating a C++ DLL and a VB 6 DLL . I was intending to create this VB DLL to monitor a Printer Port and doing it in VB is my preferred option.However, a guy who knows VB and C++ said that it is not a true Win 32 DLL and hence won't work like the C DLL. Is this true?

Thanks


User is offlineProfile CardPM
+Quote Post

Martyr2
RE: Creating A VB 6 DLL
21 Dec, 2007 - 03:19 PM
Post #2

Programming Theoretician
Group Icon

Joined: 18 Apr, 2007
Posts: 5,655



Thanked: 313 times
Expert In: C/C++, Java, VB, VB.NET, C#, PHP, Web Development, HTML & CSS, Javascript

My Contributions
Well they are partially right. Typically a VB6 environment generates ActiveX Dll files which are files that make use of a separate linker and links it in such a way that it is not considered a Windows DLL. It doesn't create a standard export file to let other languages know what functions it has and is used as an activeX object. Secondly it doesn't usually go deep enough to listen to hardware and communicate with hardware on a low level language. But you can rig VB6 to generate true Windows DLLs, by first creating an export file with the project, intercepting its call to the linker application and modifying its parameters. Most people find this process a bit tedious and it can be. But it can be done with a little hard work.

However most people just go with the easier route of creating a Win32 DLL in C++ which also has the power to go to the level of hardware. Most drivers for your hardware (like the keyboard and mouse) are actually DLL files written in C/C++ believe it or not.

So in short, the guy is right in the general case, but VB6 can generate windows DLLs with a little modifications. If you can I would go with C++ and just write it all out. It will make modifications easier later as well and there is little less of a chance of screwing your software up by misconfiguration.

Hope that helps answer your question.

"At DIC we be DLL creating code ninjas!" decap.gif
User is offlineProfile CardPM
+Quote Post

born2c0de
RE: Creating A VB 6 DLL
22 Dec, 2007 - 05:57 AM
Post #3

printf("I'm a %XR",195936478);
Group Icon

Joined: 26 Nov, 2004
Posts: 4,029



Thanked: 38 times
Dream Kudos: 2800
Expert In: 80x86 Assembly, C/C++, VB6, VB.NET, C#, J2SE, Win32 API, Reversing

My Contributions
VB wasn't designed for writing DLL files. Write the code in C.

QUOTE
Most drivers for your hardware (like the keyboard and mouse) are actually DLL files written in C/C++ believe it or not.

Not quite. That was true for the 16-bit Architecture. But with the 32/64 bit architecture, hardware access is permitted only for programs that run in Ring 0 of the Operating System. This includes driver files (which have extension .sys and not .dll)

Unlike writing code in High Level Languages, Driver-level code expects the Programmer to manage memory, which is pretty tedious.

Hence DLL Files are written which perform all the memory management and call the driver file which does the real work.
User is offlineProfile CardPM
+Quote Post

Fonz
RE: Creating A VB 6 DLL
29 Dec, 2007 - 03:40 PM
Post #4

New D.I.C Head
*

Joined: 21 Dec, 2007
Posts: 2

Thanks to both of you for your valuable comments

ALL the BEST for 2008!

Regards
Fonz smile.gif
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 1/8/09 05:46PM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live VB Help!

VB Tutorials

Reference Sheets

VB Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month