Solved

DLL Declaration

Posted on 2000-04-12
7
283 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 
LVL 69

Expert Comment

by:Éric Moreau
Comment Utility
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
Comment Utility
I tried and it said it had no entry point, whatever that means.
0
 
LVL 69

Expert Comment

by:Éric Moreau
Comment Utility
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
Comment Utility
Answer accepted
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

772 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