Solved

Call an entry point in a VB-created DLL

Posted on 2001-06-08
7
183 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 45

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
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 
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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
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…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

747 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

11 Experts available now in Live!

Get 1:1 Help Now