Solved

Creating a DLL that uses MFC

Posted on 2006-06-15
4
224 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
[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
  • 3
4 Comments
 
LVL 12

Accepted Solution

by:
rajeev_devin earned 500 total points
ID: 16912578
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
ID: 16912604
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
ID: 16914595
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
ID: 16917386
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

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

Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
Introduction This article is a continuation of the C/C++ Visual Studio Express debugger series. Part 1 provided a quick start guide in using the debugger. Part 2 focused on additional topics in breakpoints. As your assignments become a little more …
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

631 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