Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Using external DLL's

Posted on 1998-10-22
2
Medium Priority
?
189 Views
Last Modified: 2013-11-20
I am quite new to MFC, i usually program in Visual Basic. In VB it is very easy to use external dll's, you just need the dll and you need to know which functions the dll implements. But how do you use external dll's in MFC, do you need the .h and the .lib file for the dll in order to use it in your program?? And does the dll have to be a MFC dll?? I've heard something about LoadLibrary, but wouldn't know exactly how to use it! I mean if you can do it in BV without .h and .lib files surely you can do it MFC without those files! btw, i am using VC++ 6.0!
0
Comment
Question by:thomasschmidt
2 Comments
 
LVL 1

Accepted Solution

by:
Bridge earned 300 total points
ID: 1323736
HINSTANCE hDLL;               // Handle to DLL
LPFNDLLFUNC1 lpfnDllFunc1;    // Function pointer
DWORD dwParam1;
UINT  uParam2, uReturnVal;

hDLL = LoadLibrary("MyDLL");

if( hDLL != NULL )
{
   lpfnDllFunc1 = (LPFNDLLFUNC1)GetProcAddress(hDLL, "DLLFunc1" );

if( lpfnDllFunc1 )
   uReturnVal = lpfnDllFunc1(dwParam1, uParam2);

FreeLibrary(hDLL);

0
 

Author Comment

by:thomasschmidt
ID: 1323737
somehow this question got posted twice, but i'll give you the points anyway(even though there are errors in the code)!
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…

879 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