Solved

DLL Declaration

Posted on 2000-04-12
7
325 Views
Last Modified: 2010-05-02
This guy made his own dll AceVB.dll he declared it in this project:

Declare Function AceTimer Lib "AceVB.dll" () As Integer

He didn't declare the full path to the dll, so I was wondering how you can get away with this. Does registering the dll allow you to access it this way (by just using it's name and not it's path).

Also, this seems stupid to me becsuase if the answer is yes, then why not get a reference on it in the project and use it like an object in your project.
0
Comment
Question by:tyy8
  • 3
  • 3
7 Comments
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 2708674
You can't register that kind of DLL.

To access it, the DLL must be place in a folder of your path (type Path a the command prompt).
0
 
LVL 3

Accepted Solution

by:
peteyhiggins earned 50 total points
ID: 2708855
For certain directories on your computer, the operating system automatically looks in those to see if a dll or exe is present in them.

C:/winnt/system32 is an example of this on Windows NT.

That's why when you want to unregister a DLL, you can type regsvr32 name.dll.  This calls the regsvr32 application that's located in the sytem32 directory, even though you don't have to specify which directory regsvr32 is in, your computer automatically looks for it there.

To see this, on a Windows NT computer, right-click My Computer, go to properties and click the environment tab.  There are listings for both System Variables and User Variables.  Both of these have a path listing that will show you all of the folders that the computer looks in to find dlls and exes.

Peter

0
 

Author Comment

by:tyy8
ID: 2709164
Okay, but is it possible to declare your dll that way (like something from the WinAPI) and access that function directly.

To emoreau: Th setup program did register it on my system, so I don't understand what you mean when you say you can't register that kind of dll
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 70

Expert Comment

by:Éric Moreau
ID: 2709203
DLL that are registred are used by automation. To use them, you set a reference to it (Menu Project->References) and instantiate it (dim x as AceVB).

This DLL, can be distributed but is not necessarely registered. Can you register it manually (with regsvr32.exe)?
0
 

Author Comment

by:tyy8
ID: 2717388
I tried and it said it had no entry point, whatever that means.
0
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 2717405
So this means that this DLL isn't refered (found) via the registry. So it it found via the path.

There are 2 kind of DLL.
-Automation
-Function library.

Automation DLL are referenced and use as an object and then access properties and methods.

Function DLL are librairies that you declare like you did to use.

«then why not get a reference on it»
Because you can't reference a function library DLL that isn't registered.
0
 

Author Comment

by:tyy8
ID: 2899502
Answer accepted
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

713 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question