Solved

Loading a dll

Posted on 1998-06-09
2
168 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
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: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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
ODBC Connection Logging, ADO.NET 6 69
sumDigits challenge 9 170
format the code in java 6 101
fix34  challenge 9 140
Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
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.
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

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