Click here to Skip to main content
15,898,036 members
Articles / Desktop Programming / MFC

Creating and consuming MFC DLLs for Beginners

Rate me:
Please Sign up or sign in to vote.
4.44/5 (89 votes)
18 Aug 2012CPOL4 min read 519.2K   15.3K   131  
The objective of this tutorial is to demonstrate in a step by step manner how to build and call methods present in a DLL using Visual C++ 6.0. We are going to develop a DLL that takes in a string as input parameter and returns the string prefixed with a "Hello".
// MyClass.cpp: implementation of the CMyClass class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "MyDll.h"
#include "MyClass.h"

#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

CMyClass::CMyClass()
{

}

CMyClass::~CMyClass()
{

}


CString CMyClass::SayHello(CString strName)
{
	//Return the input string with a Hello prefixed 
	return "Hello " + strName;
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Product Manager
India India
Imran is a software professional with 9 years of development experience and has worked on JAVA, VB6, VC6, C# & some JavaScript.

He is interested in Hi-Performance code, OO Methodology, OS API's, Optimizing Windows, Tweaking IE.

For the last few years Imran has specialized in developing robust, hi-performance applications & GUI's (Swing) for MNC's.

http://techspot121.blogspot.com/

Comments and Discussions