📄 robot1.h
字号:
#ifndef ROBOT1_H
#define ROBOT1_H
// Get needed include files
#include "IRobot.h"
#include "IDrawbl.h"
class ComRobot : public CCmdTarget
{
public:
// Constructor and destructor
ComRobot();
virtual ~ComRobot();
protected:
// IRobot members
BEGIN_INTERFACE_PART(RobotInner, IRobot)
STDMETHOD(Initialize) (ULONG ulXPos, ULONG ulYPos);
STDMETHOD(TurnTo) (USHORT usDegrees);
STDMETHOD(GetCurrentHeading) (PUSHORT pusDegrees);
STDMETHOD(GetCurrentPosition) (PULONG pulXPos, PULONG pulYPos);
STDMETHOD(MoveForward) (ULONG ulNumUnits);
STDMETHOD(MoveBackward) (ULONG ulNumUnits);
END_INTERFACE_PART(RobotInner)
// ISimpleDrawable
BEGIN_INTERFACE_PART(DrawInner, ISimpleDrawable)
STDMETHOD(Draw)(HDC hDC);
END_INTERFACE_PART(DrawInner)
DECLARE_INTERFACE_MAP()
DECLARE_OLECREATE(ComRobot)
DECLARE_DYNCREATE(ComRobot)
private:
// Member data
USHORT m_usCurrHeading;
ULONG m_ulCurrXPos, m_ulCurrYPos;
// Private methods
VOID DrawHeading(CDC& DC);
};
typedef ComRobot* PComRobot;
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -