Solved

Creating a DLL that uses MFC

Posted on 2006-06-15
4
204 Views
Last Modified: 2010-04-01
I have never created a DLL before.  I am using MSVC++ 6.0.  I would like to create a new DLL that uses MFC.  What is the best way to do this.  I have tried creating a Win32 DDL and it is not obvious to me how I enable MFC support.
0
Comment
Question by:jribble
  • 3
4 Comments
 
LVL 12

Accepted Solution

by:
rajeev_devin earned 500 total points
Comment Utility
Goto File > New > Projects > Select MFC AppWizard (dll).
And then give the project a name and click OK.
You MFC DLL base is ready.

good luck !
0
 
LVL 12

Assisted Solution

by:rajeev_devin
rajeev_devin earned 500 total points
Comment Utility
If you just want to enable MFC in your Win32 DLL.
Then goto Project > Settings > General > I Microsoft Foundation Classes combo select
Use MFC in a Static Libray, or
Use MFC in a Shared Libray.

Your project is now MFC compatible.
0
 

Author Comment

by:jribble
Comment Utility
Ok, that was easy enough.  Maybe its not fair to ask another question, but how do I add a class/function and make it available to my application?
0
 
LVL 12

Expert Comment

by:rajeev_devin
Comment Utility
Put the declaration of the function or class in a header file.
Put the definition of the function or class in a source file.

In your application you need to include the header file.
#include "mydll.h"

In addition you will get a .lib file along with the .dll file.
In your linked settings add this .lib file to avoid linking error.

thats it.
good luck !
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

763 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now