Solved

Loading a dll

Posted on 1998-06-09
2
167 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

ScreenConnect 6.0 Free Trial

Want empowering updates? You're in the right place! Discover new features in ScreenConnect 6.0, based on partner feedback, to keep you business operating smoothly and optimally (the way it should be). Explore all of the extras and enhancements for yourself!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to create frequencies of a variable from SAS dataset? 10 125
Named range not carried over 10 63
Detect CR LF to each line 12 162
no14 challenge 14 69
This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
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.

831 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