Solved

Call an entry point in a VB-created DLL

Posted on 2001-06-08
7
187 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
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 
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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Vb.net 2008 2 60
VB 6.0 printer how to align 6 62
Run code from text file in vb 1 65
Export Data to Different .csv Files 26 105
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
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…
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…

809 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