0

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?

2
Contributors
1
Reply
2
Views
10 Years
Discussion Span
Last Post by Ancient Dragon
0

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
};
Votes + Comments
Where'd all your knowledge come from? :) --joeprogrammer
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.