📄 sort.cpp
字号:
// Sort.cpp : implementation file
//
#include "stdafx.h"
#include "stdafx.h"
#include "Sort.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CSort
IMPLEMENT_DYNCREATE(CSort, CCmdTarget)
CSort::CSort()
{
EnableAutomation();
// To keep the application running as long as an OLE automation
// object is active, the constructor calls AfxOleLockApp.
AfxOleLockApp();
}
CSort::~CSort()
{
// To terminate the application when all objects created with
// with OLE automation, the destructor calls AfxOleUnlockApp.
AfxOleUnlockApp();
}
void CSort::OnFinalRelease()
{
// When the last reference for an automation object is released
// OnFinalRelease is called. The base class will automatically
// deletes the object. Add additional cleanup required for your
// object before calling the base class.
CCmdTarget::OnFinalRelease();
}
BEGIN_MESSAGE_MAP(CSort, CCmdTarget)
//{{AFX_MSG_MAP(CSort)
// NOTE - the ClassWizard will add and remove mapping macros here.
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
BEGIN_DISPATCH_MAP(CSort, CCmdTarget)
//{{AFX_DISPATCH_MAP(CSort)
DISP_PROPERTY_NOTIFY(CSort, "LargerNumber", m_largerNumber, OnLargerNumberChanged, VT_R8)
DISP_FUNCTION(CSort, "Sort", Sort, VT_R8, VTS_R8 VTS_R8)
//}}AFX_DISPATCH_MAP
END_DISPATCH_MAP()
// Note: we add support for IID_ISort to support typesafe binding
// from VBA. This IID must match the GUID that is attached to the
// dispinterface in the .ODL file.
// {F67D8ED2-C350-11D3-9462-0000000038B2}
static const IID IID_ISort =
{ 0xf67d8ed2, 0xc350, 0x11d3, { 0x94, 0x62, 0x0, 0x0, 0x0, 0x0, 0x38, 0xb2 } };
BEGIN_INTERFACE_MAP(CSort, CCmdTarget)
INTERFACE_PART(CSort, IID_ISort, Dispatch)
END_INTERFACE_MAP()
// {F67D8ED3-C350-11D3-9462-0000000038B2}
IMPLEMENT_OLECREATE(CSort, "ASDll.Sort", 0xf67d8ed3, 0xc350, 0x11d3, 0x94, 0x62, 0x0, 0x0, 0x0, 0x0, 0x38, 0xb2)
/////////////////////////////////////////////////////////////////////////////
// CSort message handlers
double CSort::Sort(double x0, double x1)
{
// TODO: Add your dispatch handler code here
CString str;
double t;
if(x0>x1)
{
t=x0;
x0=x1;
x1=t;
}
m_largerNumber=x1;
str.Format("自动化服务器报告:大数为%f",m_largerNumber);
AfxMessageBox(str);
return m_largerNumber;
}
void CSort::OnLargerNumberChanged()
{
// TODO: Add notification handler code
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -