Re: VB6 - why isnt a straight Win32 DLL offered as a project type?

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance




"Mike Williams" <mike@xxxxxxxxxxxxxxxxx> wrote in message
news:u08xbe9xHHA.988@xxxxxxxxxxxxxxxxxxxxxxx
"mayayana" <mayaXXyana1a@xxxxxxxxxxxxxxxx> wrote in message
news:ptOmi.7578$rR.1695@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

It's actually fairly easy, but unorthodox. You have
to bypass VB's "hellpfulness".
www.jsware.net/jsware/vbcode.php3#vdll

Okay. I'll bite. Being a simple hobbyist I never get involved in these
things, but in layman's terms what exactly is the difference between an
ActiveX DLL and a "normal" Win32 DLL. Is it something to do with a normal
DLL not requiring to be registered, or is it deeper than that? Also, when
I
use functions in a DLL myself I do so either because I am calling standard
functions provided by Windows that would otherwise be difficult to code or
because I am calling a function in a library that has been written in C or
perhaps ASM and that does its work faster than I would be able to do it
myself in compiled VB code. So, why would I want to create a DLL in VB6
and
call the functions it provides when I can simply write those functions in
a
standard code module that I can pull into my projects and that are going
to
execute at the same speed? In other words, what is the advantage of
calling
a function in a VB6 compiled DLL as opposed to calling an exactly similar
function in a standard code module. What am I gaining by doing so? Does it
perhaps enable me to more easily use multiple threads? I don't know
anything
at all about writing DLLs in VB and I think it's about time I learned how
to
do it (and, just as importantly, why to do it) ;-)

Mike


The type of DLL Stephen is talking about is simply a shared library that can
can be linked into a program's address space at runtime (dymanic linking).
If shared libraries were not supported then each application would have to
be statically linked to 'shared code' at compile time.

In the simple example of using the WinAPI, static compiles make programs
rather large. It also causes problems should a program be ported to another
or upgraded OS. All programs would have to be recompiled to run on the new
OS. This is inconvenient, thus 'shared' libraries' were created.

While vitally important to apps that access universal items such as the
WinAPI, it is less useful to home-brew applications unless those apps are
part of suites that share a lot of code. Even then, it is usually more
useful to share objects not code, thus an ActiveX component is more useful.

-ralph


.



Relevant Pages

  • Re: Port a GTK+ and C++/C app from Linux to Winders using C#
    ... William I would like to offer my thanks to you for offering your ideas. ... Rather than compile the executables, compile them as dll files in ... >> embedded (the gui sets the parameters for the command line apps then ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: When were scanf_s functions introduced?
    ... one that is a "web install" (checks dependencies and only downloads those that are missing, ... then the amount of space for the CRT installer is probably not going to matter much and ... the CRT dll MSVCR80.dll? ... Say I have several different apps to deploy. ...
    (microsoft.public.platformsdk.security)
  • Re: VBA and VSTO
    ... If you compile in VB6 with Global MultiUse than all you have to do is set a reference in Excel to your dll via Tools, References and you can access your functions in the dll directly. ... You will have to register the dll as well with Windows with Regsvr32, but that can be done quite simply in VBA. ...
    (microsoft.public.excel.programming)
  • Re: HOW CAN I OPEN A COM PROJECT COMPILED IN VS2005, IN VS2003?
    ... I keep getting the .exe output when I compile in the VC7. ... the General Configuration Type to be .dll in the Project Property. ... Microsoft MVP, MCSD ... instead create my own folders for file grouping... ...
    (microsoft.public.win32.programmer.ole)
  • Re: Followup: Native win32 apps still require .NET runtime?
    ... >any thought I had of compiling my MFC app with CLR. ... I've written lots of MFC apps but haven't been tempted to recompile ... it may fix the bug I've seen, so I don't want to do that. ... I was originally skeptical someone told me about the DLL problem. ...
    (microsoft.public.dotnet.languages.vc)