DLL Procedures

The document shown in the following site discusses how to access procedures from DLLs by declaring a DLL Procedure.
As we know, we also can access procedures from DLLs by setting a reference through the Project/References ... from the menu to reveal the References dialog.

I wonder whether they are related each other or totally different concept.
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

John Mc HaleConnect With a Mentor Forensic Computer Examiner, Analyst/Programmer & Database ArchitectCommented:
The Project/References Dialog within Visual Basic allows the programmers to specify references to DLLs and OCXs which support automation. This allows Visual Basic to discover the DLLs/OCXs automation interfaces, and therefore allows the programmer to create instances of objects exported by those DLLs. "Standard" DLLs which do not support automation (such as many of those found within the Win32 API) have therefore to be treated slightly differently ... as the Microsoft Document outlines. This covers the case in which you wish to interface directly to DLLS which do not have automation interfaces.


Suppose within the Projects/References Dialog, you reference an automation DLL called RDO.dll, containing Remote Data Objects, then within your VB code, you might use statements such as

Dim rdoobj as rdoConnection

Because you have registered the RDO Dll with your app, VB "discovers" all the automation interfaces within the DLL, and knows how to create an OLE rdoConnection object.

On the other hand, suppose you wish to use the Win32 API function "GetComputerName()" within your app, because this function does not have an automation interface, you have to declare it within your code as the Microsoft Documentation outlines.

Éric MoreauSenior .Net ConsultantCommented:
Only the extension is the same.

DLL that we reference in the Project->References menu allow automation. You create instances and use them as objects.

DLL that are talked in the articles are librairies of functions/subs. Since you don't reference them and you don't instanciate them, you have to declare them. These functions/subs are often what we call API functions!
Don't like to say a totally different concept, yet it is different. In the reference menu you can apply VB dll's in your app. To reference procedures you still have to declare the procedure.
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

You said same thing that emoreau stated
leeannAuthor Commented:
John Mc HaleForensic Computer Examiner, Analyst/Programmer & Database ArchitectCommented:
maybe so, but I think the example helps to clarify it a bit, don't you think?
All Courses

From novice to tech pro — start learning today.