Solved

Call an entry point in a VB-created DLL

Posted on 2001-06-08
7
189 Views
Last Modified: 2010-05-02
As an experiment I wrote the simplest of VB DLLs which contained one public Function (in a module) and one public Property Let (in a Class). When I tried to call those entry points from another VB program I got a "Can't find DLL entry point..." error when I tried using the name of either the function or the Let in the DLL. I've successfully used DLLs written in C++ so I know how to Declare the DLL so I don't think that's the problem. Could someone supply me with a trivial example of how to create and call an entry point in a VB DLL?
0
Comment
Question by:Martin Liss
[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
7 Comments
 
LVL 3

Expert Comment

by:Joebob
ID: 6168731
The reason the call failed is because DB will only create ActiveX DLLs.  A standard Win32 DLL, such as many C++ DLLS, can be called after using the DECLARE keyword in your module.  ActiveX DLLs are only accessable by setting a reference to the DLL in the Projects->References menu and then instantiating the public class.  With VB DLLs, you will not be able to directly call the function in the standard code module, you can only call functions in classes that are public and you have instantiated.
0
 
LVL 1

Accepted Solution

by:
ny971181 earned 50 total points
ID: 6168909
Joebob explains the reason, anyhow, i think it is a little bit too general for questionior. not to offend you joebob,

coming from the similar background, I like to know the details of the explaination, so if you are not sure what joebob is talking about, hit us again, i will post more plain english comment for you.

again, not to offend anyone.
0
 
LVL 47

Author Comment

by:Martin Liss
ID: 6168993
I'm pretty sure I know what Joebob is saying, but if you want to give a fuller explanation, please do.
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 1

Expert Comment

by:ny971181
ID: 6169106
if you understand, that is no need, like I said, joebob explains it very well in technical point of view. I don't want to take his credit away. :)
0
 
LVL 3

Expert Comment

by:Joebob
ID: 6169127
ny971181,

Please, if you feel you can explain it better(simpler) then go ahead.  I am not a member of this group to get credit or points.  I use it to learn and I like to help people when I can.  Learning how to explain things to a lower level is another type of learning, so feel free.
0
 
LVL 5

Expert Comment

by:dgorin
ID: 6169809
Joebob, I appreciate your style :)
0
 
LVL 1

Expert Comment

by:ny971181
ID: 6170001
say you have a class, myclass in your dll, you want a function call myfunction.

now you have a VB exe, you want to call that function.

1. in your dll, set the function as public instead of private.
2. either run your dll project or make your dll file.
3. in your exe, go to project, reference, check your dll file, it should appears as your dll project title.
4. initiate your object
dim o as mydll
set o = new mydll
5. call your function
o.myfunction ....

did I miss anything?

hopefully not. :)
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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.
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

749 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