This is a dynamic link library aaaaaaa. Nice method on the bottom of the CPP file, the key is
//aaaaaaa. CPP: defines the initialization routine of DLL,
//
# include "stdafx. H"
# include "aaaaaaa. H"
# ifdef _DEBUG
# define new DEBUG_NEW
# endif
//
//TODO: if the DLL is relative to the MFC DLL dynamic link,
//is from now on any call DLL export
//function of the MFC AFX_MANAGE_STATE macro must be added to the
//this function, the front of the
//
//such as:
//
//extern "C" BOOL PASCAL EXPORT ExportedFunction ()
//{
//AFX_MANAGE_STATE (AfxGetStaticModuleState ());
////here for ordinary function body
//}
//
//this macro before any call MFC
//appear in each function is very important, which means that the
//it must be as the first statement in the function
//, even before all the object variable declarations,
//this is because their constructor can generate MFC
//DLL call,
//
//the other detailed information,
//please refer to the MFC technology shows 33 and 58,
//
//CaaaaaaaApp
BEGIN_MESSAGE_MAP (CaaaaaaaApp CWinApp)
END_MESSAGE_MAP ()
//CaaaaaaaApp structure
CaaaaaaaApp: : CaaaaaaaApp ()
{
//TODO: add code structure, here
//place all the important initialization in InitInstance
M_gdiplusToken=NULL;
}
//only a CaaaaaaaApp object
CaaaaaaaApp theApp;
//CaaaaaaaApp initialization
BOOL CaaaaaaaApp: : InitInstance ()
{
Gdiplus: : GdiplusStartupInput GdiplusStartupInput;
Gdiplus: : GdiplusStartup (& amp; M_gdiplusToken, & amp; GdiplusStartupInput, NULL);
CWinApp: : InitInstance ();
Return TRUE;
}
Int CaaaaaaaApp: : ExitInstance ()
{
//TODO: Add your specialized code here and/or call the base class
//unloading GdiPlus
If (m_gdiplusToken)
Gdiplus: : GdiplusShutdown (m_gdiplusToken);
Return CWinApp: : ExitInstance ();
}
Extern "C" long PASCAL EXPORT _stdcall nice (HDC HDC, long start, long end)
{
AFX_MANAGE_STATE (AfxGetStaticModuleState ());
//here for ordinary function body
Graphics Graphics (hDC);
Pen bluePen (Color (255, 0, 0, 255));
Pen redPen (Color (255, 255, 0, 0));
Int y=end;
For (int x=start; x <=end; X +=5)
{
Graphics. DrawLine (& amp; BluePen, start, y, x, start);
Graphics. DrawLine (& amp; RedPen, end, x, y, end);
Y=5;
}
return 0;
}
CodePudding user response:
The nice () function in Graphics, Pen didn't release!CodePudding user response: