?
Solved

DLL Declaration

Posted on 2000-04-12
7
Medium Priority
?
345 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 200 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
Technology Partners: 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

Independent Software Vendors: 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!

Question has a verified solution.

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

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
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…
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…
Suggested Courses
Course of the Month15 days, 16 hours left to enroll

741 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