Solved

Call an entry point in a VB-created DLL

Posted on 2001-06-08
7
184 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
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 46

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
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 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

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

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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…
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…

895 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

14 Experts available now in Live!

Get 1:1 Help Now