Solved

Loading a dll

Posted on 1998-06-09
2
169 Views
Last Modified: 2013-11-20
I have an external function in a dll , how can I access this function?
0
Comment
Question by:sore
[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
2 Comments
 
LVL 7

Accepted Solution

by:
galkin earned 200 total points
ID: 1316449
Load library dinamically with LoadLibrary. It returns DLL instance handle. Declare pointer to the function exported from a DLL. Use GetProcAddress Win32 API function to get exported function pointer. This function takes two arguments, first is instance handle obtained via call to LoadLibrary and the second is function name. you also need to cast returned pointer to function to appropriate type. Then you can call the function via the pointer.
0
 

Expert Comment

by:t004024
ID: 1316450
Just a small question, why go into loadlibrary and things like that when U can either, just link the application with the library and call that function, or import it in the IMPORTS section of the def file and again call the function directly??? Why not let the DLL load automatically ??
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

Suggested Solutions

Title # Comments Views Activity
Expand data scrubbing tool 13 36
Define unique primary key 9 95
sumHeights  challenge 17 79
My project did see openJDK that I installed. What could be the problem 7 161
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
In this post we will learn different types of Android Layout and some basics of an Android App.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

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