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
Solved

Call an entry point in a VB-created DLL

Posted on 2001-06-08
7
188 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
Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

 
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: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
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…

837 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