方法之一:使用MFC提供的修饰符号_declspec(dllexport);要输出整个的类,对类使用_declspec(_dllexpot);如:class AFX_EXT_CLASS CTextDoc : public CDocument{}extern "C" AFX_EXT_API void WINAPI InitMYDLL(); 看到这里我明白了LHL7Manage类是动态链接库导出的类。太笨了,弄了这么久才弄清楚。
MFC 擴充 DLL會使用巨集AFX_EXT_CLASS匯出類別;連結至 MFC 延伸模組 DLL 的可執行檔會使用巨集匯入類別。使用 AFX_EXT_CLASS巨集,用來建置 MFC 延伸模組 DLL 的相同頭檔可以與連結至 DLL 的可執行檔搭配使用。 在DLL 的標頭檔中,將 AFX_EXT_CLASS關鍵詞新增至類別的宣告,如下所示: ...
使用 AFX_EXT_CLASS 宏,用于生成扩展 DLL 的相同头文件可以与链接到 DLL 的可执行文件一起使用。 在DLL 的头文件中,将 AFX_EXT_CLASS 关键字添加到类的声明中,如下所示: class AFX_EXT_CLASS CMyClass : public Cdocument{// }; 当定义了预处理 _AFXDLL 和 _AFXEXT 时,该宏被 MFC 定义为 __declsp...
class AFX_EXT_CLASS CMyClass : public CDocument { // }; 這個巨集會在前置處理器符號_AFXDLL和_AFXEXT已定義時,由 MFC 定義成__declspec(dllexport)。但是會在已定義_AFXDLL卻沒有定義_AFXEXT時,定義成__declspec(dllimport)。當已定義時,前置處理器符號_AFXDLL便會指示出目標可執行檔 (DLL 或應用程式)...
使用AFX_EXT_CLASS 导出和导入 扩展DELL使用 AFX_EXT_CLASS 宏导出类;链接到扩展 DLL 的可执行文件使用该宏导入类。使用 AFX_EXT_CLASS 宏,用于生成扩展 DLL 的相同头文件可以与链接到 DLL 的可执行文件一起使用。 在DLL 的头文件中,将 AFX_EXT_CLASS 关键字添加到类的声明中,如下所示: ...
AfxDaoInit AfxDaoTerm AfxDebugBreak (MFC) AfxDbInitModule AfxDoForAllClasses AfxDoForAllObjects AfxDrawDitheredBitmap AfxDrawGrayBitmap afxDump (CDumpContext in MFC) AfxDump (MFC) AfxDumpStack AfxEnableControlContainer AfxEnableMemoryLeakDump AfxEnableMemoryTracking AfxEndThread AFX_EXT_CLASS AfxExtract...
classAFX_EXT_CLASSCMyClass:publicCDocument {// }; Další informace naleznete v tématuExport a Import pomocí AFX_EXT_CLASS. Požadavky Záhlaví: **afxv_**dll.h Viz také Koncepty MFC – makra a globální prvky
3.使用AFX_EXT_CLASS导出 MFC扩展DLL使用AFX_EXT_CLASS宏来导出类,链接这种DLL的应用程序或其他DLL使用这个宏来导入类。 AFX_EXT_CLASS宏如果用于DLL应用程序的实现中,则表示输出;如果用于使用DLL的应用程序中,则表示输入。要输出整个的类,对类使用_declspec(_DLLexpot);要输出类的成员函数,则对该函数使用_declsp...
Making MFC extension DLLs is very easy with Visual C++ version 2.0, because AppWizard can now create the framework for a DLL. Exporting classes from the DLL is very simple—just add AFX_EXT_CLASS to the class definition: class AFX_EXT_CLASS CGLView : public CView { . . . }; ...
class AFX_NOVTABLE CView : public CWnd MembersProtected ConstructorsExpand table NameDescription CView::CView Constructs a CView object.Public MethodsExpand table NameDescription CView::DoPreparePrinting Displays Print dialog box and creates printer device context; call when overriding the OnPreparePri...