Hello friend
I have a question.I have a dll that use a class that derived from CDialog. how i can export class so that i can access of its member function in seprate application?

1. create an MFC Extension DLL

2. In the .h file, define a macro similar to below

// The following ifdef block is the standard way of creating macros which 
// make exporting from a DLL simpler. All files within this DLL are compiled 
// with the __GXDLCODE_EXPORTS__  symbol defined on the command line. This 
// symbol should not be defined on any project that uses this DLL. This way 
// any other project whose source files include this file see GXDLCODE_API 
// functions as being imported from a DLL, whereas this DLL sees symbols
// defined with this macro as being exported.
#ifdef GXDLCODE_EXPORTS
#define GXDLCODE_API __declspec(dllexport)
#else
#define GXDLCODE_API __declspec(dllimport)
#endif

3. In the .h file where your class is declared

class GXDLCODE_API MyClass : public CDialog
{
   // your class code here
};
commented: Where'd all your knowledge come from? :) --joeprogrammer +4
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.