📄 globaldllobjects.h
字号:
// GlobalDllObjects.h : main header file for the GLOBALDLLOBJECTS DLL
//
#if !defined(AFX_GLOBALDLLOBJECTS_H__25729FC2_08C5_11D2_8DB2_204C4F4F5020__INCLUDED_)
#define AFX_GLOBALDLLOBJECTS_H__25729FC2_08C5_11D2_8DB2_204C4F4F5020__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#ifndef __AFXWIN_H__
#error include 'stdafx.h' before including this file for PCH
#endif
#include "resource.h" // main symbols
/////////////////////////////////////////////////////////////////////////////
// CGlobalDllObjectsApp
// See GlobalDllObjects.cpp for the implementation of this class
//
#ifdef GLOBALDLLOBJECTS_EXPORTS
#define GLOBALDLLOBJECTS_API __declspec(dllexport)
#else
#define GLOBALDLLOBJECTS_API __declspec(dllimport)
#endif
class CGlobalDllObjectsApp : public CWinApp
{
public:
CGlobalDllObjectsApp();
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CGlobalDllObjectsApp)
public:
virtual BOOL InitInstance();
virtual int ExitInstance();
//}}AFX_VIRTUAL
//{{AFX_MSG(CGlobalDllObjectsApp)
// NOTE - the ClassWizard will add and remove member functions here.
// DO NOT EDIT what you see in these blocks of generated code !
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
class GLOBALDLLOBJECTS_API CTest
{
public:
// the only construction of the object
// that is allowed is via the placement
// new operator
void* operator new(size_t) { return NULL; }
void* operator new(size_t, void* p) { return p; }
void operator delete(void*) {};
// display message box during object c'tor and d'tor
// to show that object is only being constructed
// when first client attaches and destructed when
// last client detaches
CTest() {
::MessageBox(NULL,"CTest c'tor",
"CTest.DLL", MB_OK);
}
~CTest() {
::MessageBox(NULL,"CTest d'tor",
"CTest.DLL", MB_OK);
}
CTest(const CTest&);
};
#define EXPORTED_DLL_FUNCTION \
__declspec(dllexport) __stdcall
void EXPORTED_DLL_FUNCTION GetTestPtr(CTest*& rpTest);
int EXPORTED_DLL_FUNCTION GetNbrOfClients();
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_GLOBALDLLOBJECTS_H__25729FC2_08C5_11D2_8DB2_204C4F4F5020__INCLUDED_)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -