Solved

DLL Declaration

Posted on 2000-04-12
7
296 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 69

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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 69

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 69

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
change vba from autofit to 13.5 width? 4 28
message box in access 4 41
Access 2013 combo box not working 3 38
TT Auto Dashboard 13 84
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

896 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now