LAPTOP-SNT8I5JK\Boounion
2025-01-03 09bedb49152fe9fe7c0997e9815a5bf542d3ed2e
1.Cim-pc端框架;
已添加19个文件
1767 ■■■■■ 文件已修改
SourceCode/Bond/Servo/ReadMe.txt 67 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/Servo.cpp 119 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/Servo.h 41 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/Servo.rc 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/Servo.vcxproj 230 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/Servo.vcxproj.filters 72 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/ServoDlg.cpp 293 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/ServoDlg.h 43 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/ServoGraph.cpp 629 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/ServoGraph.h 183 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/res/Servo.ico 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/res/Servo.rc2 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/res/application.exe.manifest 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/resource.h 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/stdafx.cpp 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/stdafx.h 54 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/targetver.h 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/x64/Debug/Res/Servo.bmp 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/x64/Debug/Res/Servo001.bmp 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/ReadMe.txt
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,67 @@
================================================================================
    MICROSOFT åŸºç¡€ç±»åº“ : Servo é¡¹ç›®æ¦‚è¿°
===============================================================================
应用程序向导已为您创建了此 Servo åº”用程序。此应用程序不仅演示 Microsoft åŸºç¡€ç±»çš„基本使用方法,还可作为您编写应用程序的起点。
本文件概要介绍组成 Servo åº”用程序的每个文件的内容。
Servo.vcxproj
    è¿™æ˜¯ä½¿ç”¨åº”用程序向导生成的 VC++ é¡¹ç›®çš„主项目文件,其中包含生成该文件的 Visual C++ çš„版本信息,以及有关使用应用程序向导选择的平台、配置和项目功能的信息。
Servo.vcxproj.filters
    è¿™æ˜¯ä½¿ç”¨â€œåº”用程序向导”生成的 VC++ é¡¹ç›®ç­›é€‰å™¨æ–‡ä»¶ã€‚它包含有关项目文件与筛选器之间的关联信息。在 IDE ä¸­ï¼Œé€šè¿‡è¿™ç§å…³è”,在特定节点下以分组形式显示具有相似扩展名的文件。例如,“.cpp”文件与“源文件”筛选器关联。
Servo.h
    è¿™æ˜¯åº”用程序的主头文件。
    å…¶ä¸­åŒ…括其他项目特定的标头(包括 Resource.h),并声明 CServoApp åº”用程序类。
Servo.cpp
    è¿™æ˜¯åŒ…含应用程序类 CServoApp çš„主应用程序源文件。
Servo.rc
    è¿™æ˜¯ç¨‹åºä½¿ç”¨çš„æ‰€æœ‰ Microsoft Windows èµ„源的列表。它包括 RES å­ç›®å½•中存储的图标、位图和光标。此文件可以直接在 Microsoft Visual C++ ä¸­è¿›è¡Œç¼–辑。项目资源包含在 2052 ä¸­ã€‚
res\Servo.ico
    è¿™æ˜¯ç”¨ä½œåº”用程序图标的图标文件。此图标包括在主资源文件 Servo.rc ä¸­ã€‚
res\Servo.rc2
    æ­¤æ–‡ä»¶åŒ…含不在 Microsoft Visual C++ ä¸­è¿›è¡Œç¼–辑的资源。您应该将不可由资源编辑器编辑的所有资源放在此文件中。
/////////////////////////////////////////////////////////////////////////////
应用程序向导创建一个对话框类:
ServoDlg.h、ServoDlg.cpp - å¯¹è¯æ¡†
    è¿™äº›æ–‡ä»¶åŒ…含 CServoDlg ç±»ã€‚此类定义应用程序的主对话框的行为。对话框模板包含在 Servo.rc ä¸­ï¼Œè¯¥æ–‡ä»¶å¯ä»¥åœ¨ Microsoft Visual C++ ä¸­ç¼–辑。
/////////////////////////////////////////////////////////////////////////////
其他功能:
ActiveX æŽ§ä»¶
    è¯¥åº”用程序包含对使用 ActiveX æŽ§ä»¶çš„æ”¯æŒã€‚
/////////////////////////////////////////////////////////////////////////////
其他标准文件:
StdAfx.h, StdAfx.cpp
    è¿™äº›æ–‡ä»¶ç”¨äºŽç”Ÿæˆåä¸º Servo.pch çš„预编译头 (PCH) æ–‡ä»¶å’Œåä¸º StdAfx.obj çš„预编译类型文件。
Resource.h
    è¿™æ˜¯æ ‡å‡†å¤´æ–‡ä»¶ï¼Œå¯ç”¨äºŽå®šä¹‰æ–°çš„资源 ID。Microsoft Visual C++ å°†è¯»å–并更新此文件。
Servo.manifest
    Windows XP ä½¿ç”¨åº”用程序清单文件来描述特定版本的并行程序集的应用程序依赖项。加载程序使用这些信息来从程序集缓存中加载相应的程序集,并保护其不被应用程序访问。应用程序清单可能会包含在内,以作为与应用程序可执行文件安装在同一文件夹中的外部 .manifest æ–‡ä»¶è¿›è¡Œé‡æ–°åˆ†å‘,它还可能以资源的形式包含在可执行文件中。
/////////////////////////////////////////////////////////////////////////////
其他注释:
应用程序向导使用“TODO:”来指示应添加或自定义的源代码部分。
如果应用程序使用共享 DLL ä¸­çš„ MFC,您将需要重新分发 MFC DLL。如果应用程序所使用的语言与操作系统的区域设置不同,则还需要重新分发相应的本地化资源 mfc110XXX.DLL。
有关上述话题的更多信息,请参见 MSDN æ–‡æ¡£ä¸­æœ‰å…³é‡æ–°åˆ†å‘ Visual C++ åº”用程序的部分。
/////////////////////////////////////////////////////////////////////////////
SourceCode/Bond/Servo/Servo.cpp
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,119 @@
// Servo.cpp : å®šä¹‰åº”用程序的类行为。
//
#include "stdafx.h"
#include "Servo.h"
#include "ServoDlg.h"
#include "ServoGraph.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
// CServoApp
BEGIN_MESSAGE_MAP(CServoApp, CWinApp)
    ON_COMMAND(ID_HELP, &CWinApp::OnHelp)
END_MESSAGE_MAP()
// CServoApp æž„造
CServoApp::CServoApp()
{
    // æ”¯æŒé‡æ–°å¯åŠ¨ç®¡ç†å™¨
    m_dwRestartManagerSupportFlags = AFX_RESTART_MANAGER_SUPPORT_RESTART;
    // TODO: åœ¨æ­¤å¤„添加构造代码,
    // å°†æ‰€æœ‰é‡è¦çš„初始化放置在 InitInstance ä¸­
}
// å”¯ä¸€çš„一个 CServoApp å¯¹è±¡
CServoApp theApp;
// CServoApp åˆå§‹åŒ–
BOOL CServoApp::InitInstance()
{
    // å¦‚果一个运行在 Windows XP ä¸Šçš„应用程序清单指定要
    // ä½¿ç”¨ ComCtl32.dll ç‰ˆæœ¬ 6 æˆ–更高版本来启用可视化方式,
    //则需要 InitCommonControlsEx()。  å¦åˆ™ï¼Œå°†æ— æ³•创建窗口。
    INITCOMMONCONTROLSEX InitCtrls;
    InitCtrls.dwSize = sizeof(InitCtrls);
    // å°†å®ƒè®¾ç½®ä¸ºåŒ…括所有要在应用程序中使用的
    // å…¬å…±æŽ§ä»¶ç±»ã€‚
    InitCtrls.dwICC = ICC_WIN95_CLASSES;
    InitCommonControlsEx(&InitCtrls);
    CWinApp::InitInstance();
    AfxEnableControlContainer();
    // åˆ›å»º shell ç®¡ç†å™¨ï¼Œä»¥é˜²å¯¹è¯æ¡†åŒ…含
    // ä»»ä½• shell æ ‘视图控件或 shell åˆ—表视图控件。
    CShellManager *pShellManager = new CShellManager;
    // æ¿€æ´»â€œWindows Native”视觉管理器,以便在 MFC æŽ§ä»¶ä¸­å¯ç”¨ä¸»é¢˜
    CMFCVisualManager::SetDefaultManager(RUNTIME_CLASS(CMFCVisualManagerWindows));
    // æ ‡å‡†åˆå§‹åŒ–
    // å¦‚果未使用这些功能并希望减小
    // æœ€ç»ˆå¯æ‰§è¡Œæ–‡ä»¶çš„大小,则应移除下列
    // ä¸éœ€è¦çš„特定初始化例程
    // æ›´æ”¹ç”¨äºŽå­˜å‚¨è®¾ç½®çš„æ³¨å†Œè¡¨é¡¹
    // TODO: åº”适当修改该字符串,
    // ä¾‹å¦‚修改为公司或组织名
    SetRegistryKey(_T("应用程序向导生成的本地应用程序"));
    // æœ¬ç¨‹åºæ–‡ä»¶ç›®å½•
    TCHAR sDrive[_MAX_DRIVE];
    TCHAR sDir[_MAX_DIR];
    TCHAR sFilename[_MAX_FNAME], sAppFilename[_MAX_FNAME];
    TCHAR sExt[_MAX_EXT];
    GetModuleFileName(AfxGetInstanceHandle(), sAppFilename, _MAX_FNAME);
    _tsplitpath_s(sAppFilename, sDrive, sDir, sFilename, sExt);
    m_strAppDir = CString(sDrive) + CString(sDir);
    m_strAppFile = CString(sFilename);
    // æ³¨å†ŒæŽ§ä»¶
    CServoGraph::RegisterWndClass();
    CServoDlg dlg;
    m_pMainWnd = &dlg;
    INT_PTR nResponse = dlg.DoModal();
    if (nResponse == IDOK)
    {
        // TODO: åœ¨æ­¤æ”¾ç½®å¤„理何时用
        //  â€œç¡®å®šâ€æ¥å…³é—­å¯¹è¯æ¡†çš„代码
    }
    else if (nResponse == IDCANCEL)
    {
        // TODO: åœ¨æ­¤æ”¾ç½®å¤„理何时用
        //  â€œå–消”来关闭对话框的代码
    }
    else if (nResponse == -1)
    {
        TRACE(traceAppMsg, 0, "警告: å¯¹è¯æ¡†åˆ›å»ºå¤±è´¥ï¼Œåº”用程序将意外终止。\n");
        TRACE(traceAppMsg, 0, "警告: å¦‚果您在对话框上使用 MFC æŽ§ä»¶ï¼Œåˆ™æ— æ³• #define _AFX_NO_MFC_CONTROLS_IN_DIALOGS。\n");
    }
    // åˆ é™¤ä¸Šé¢åˆ›å»ºçš„ shell ç®¡ç†å™¨ã€‚
    if (pShellManager != NULL)
    {
        delete pShellManager;
    }
    // ç”±äºŽå¯¹è¯æ¡†å·²å…³é—­ï¼Œæ‰€ä»¥å°†è¿”回 FALSE ä»¥ä¾¿é€€å‡ºåº”用程序,
    //  è€Œä¸æ˜¯å¯åŠ¨åº”ç”¨ç¨‹åºçš„æ¶ˆæ¯æ³µã€‚
    return FALSE;
}
SourceCode/Bond/Servo/Servo.h
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,41 @@
// Servo.h : PROJECT_NAME åº”用程序的主头文件
//
#pragma once
#ifndef __AFXWIN_H__
    #error "在包含此文件之前包含“stdafx.h”以生成 PCH æ–‡ä»¶"
#endif
#include "resource.h"        // ä¸»ç¬¦å·
// CServoApp:
// æœ‰å…³æ­¤ç±»çš„实现,请参阅 Servo.cpp
//
class CServoApp : public CWinApp
{
public:
    CServoApp();
public:
    // CModel m_model;
    HANDLE m_hAppMutex;
    CString m_strAppDir;
    CString m_strAppFile;
    int m_nVersionNumber;
    CString m_strVersionName;
// é‡å†™
public:
    virtual BOOL InitInstance();
// å®žçް
    DECLARE_MESSAGE_MAP()
};
extern CServoApp theApp;
SourceCode/Bond/Servo/Servo.rc
Binary files differ
SourceCode/Bond/Servo/Servo.vcxproj
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,230 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <ItemGroup Label="ProjectConfigurations">
    <ProjectConfiguration Include="Debug|Win32">
      <Configuration>Debug</Configuration>
      <Platform>Win32</Platform>
    </ProjectConfiguration>
    <ProjectConfiguration Include="Release|Win32">
      <Configuration>Release</Configuration>
      <Platform>Win32</Platform>
    </ProjectConfiguration>
    <ProjectConfiguration Include="Debug|x64">
      <Configuration>Debug</Configuration>
      <Platform>x64</Platform>
    </ProjectConfiguration>
    <ProjectConfiguration Include="Release|x64">
      <Configuration>Release</Configuration>
      <Platform>x64</Platform>
    </ProjectConfiguration>
  </ItemGroup>
  <PropertyGroup Label="Globals">
    <ProjectGuid>{66ADACE5-3166-4D1F-B30B-DE5E01FB01A2}</ProjectGuid>
    <RootNamespace>Servo</RootNamespace>
    <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
    <Keyword>MFCProj</Keyword>
  </PropertyGroup>
  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
    <ConfigurationType>Application</ConfigurationType>
    <UseDebugLibraries>true</UseDebugLibraries>
    <PlatformToolset>v140</PlatformToolset>
    <CharacterSet>Unicode</CharacterSet>
    <UseOfMfc>Dynamic</UseOfMfc>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
    <ConfigurationType>Application</ConfigurationType>
    <UseDebugLibraries>false</UseDebugLibraries>
    <PlatformToolset>v140</PlatformToolset>
    <WholeProgramOptimization>true</WholeProgramOptimization>
    <CharacterSet>Unicode</CharacterSet>
    <UseOfMfc>Dynamic</UseOfMfc>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
    <ConfigurationType>Application</ConfigurationType>
    <UseDebugLibraries>true</UseDebugLibraries>
    <PlatformToolset>v140</PlatformToolset>
    <CharacterSet>MultiByte</CharacterSet>
    <UseOfMfc>Dynamic</UseOfMfc>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
    <ConfigurationType>Application</ConfigurationType>
    <UseDebugLibraries>false</UseDebugLibraries>
    <PlatformToolset>v140</PlatformToolset>
    <WholeProgramOptimization>true</WholeProgramOptimization>
    <CharacterSet>Unicode</CharacterSet>
    <UseOfMfc>Dynamic</UseOfMfc>
  </PropertyGroup>
  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
  <ImportGroup Label="ExtensionSettings">
  </ImportGroup>
  <ImportGroup Label="Shared">
  </ImportGroup>
  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
  </ImportGroup>
  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
  </ImportGroup>
  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
  </ImportGroup>
  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
  </ImportGroup>
  <PropertyGroup Label="UserMacros" />
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
    <LinkIncremental>true</LinkIncremental>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
    <LinkIncremental>true</LinkIncremental>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
    <LinkIncremental>false</LinkIncremental>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
    <LinkIncremental>false</LinkIncremental>
  </PropertyGroup>
  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
    <ClCompile>
      <PrecompiledHeader>Use</PrecompiledHeader>
      <WarningLevel>Level3</WarningLevel>
      <Optimization>Disabled</Optimization>
      <PreprocessorDefinitions>WIN32;_WINDOWS;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
      <SDLCheck>true</SDLCheck>
    </ClCompile>
    <Link>
      <SubSystem>Windows</SubSystem>
      <GenerateDebugInformation>true</GenerateDebugInformation>
    </Link>
    <Midl>
      <MkTypLibCompatible>false</MkTypLibCompatible>
      <ValidateAllParameters>true</ValidateAllParameters>
      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
    </Midl>
    <ResourceCompile>
      <Culture>0x0804</Culture>
      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
      <AdditionalIncludeDirectories>$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
    </ResourceCompile>
  </ItemDefinitionGroup>
  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
    <ClCompile>
      <PrecompiledHeader>Use</PrecompiledHeader>
      <WarningLevel>Level3</WarningLevel>
      <Optimization>Disabled</Optimization>
      <PreprocessorDefinitions>_WINDOWS;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
      <SDLCheck>true</SDLCheck>
    </ClCompile>
    <Link>
      <SubSystem>Windows</SubSystem>
      <GenerateDebugInformation>true</GenerateDebugInformation>
    </Link>
    <Midl>
      <MkTypLibCompatible>false</MkTypLibCompatible>
      <ValidateAllParameters>true</ValidateAllParameters>
      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
    </Midl>
    <ResourceCompile>
      <Culture>0x0804</Culture>
      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
      <AdditionalIncludeDirectories>$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
    </ResourceCompile>
  </ItemDefinitionGroup>
  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
    <ClCompile>
      <WarningLevel>Level3</WarningLevel>
      <PrecompiledHeader>Use</PrecompiledHeader>
      <Optimization>MaxSpeed</Optimization>
      <FunctionLevelLinking>true</FunctionLevelLinking>
      <IntrinsicFunctions>true</IntrinsicFunctions>
      <PreprocessorDefinitions>WIN32;_WINDOWS;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
      <SDLCheck>true</SDLCheck>
    </ClCompile>
    <Link>
      <SubSystem>Windows</SubSystem>
      <GenerateDebugInformation>true</GenerateDebugInformation>
      <EnableCOMDATFolding>true</EnableCOMDATFolding>
      <OptimizeReferences>true</OptimizeReferences>
    </Link>
    <Midl>
      <MkTypLibCompatible>false</MkTypLibCompatible>
      <ValidateAllParameters>true</ValidateAllParameters>
      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
    </Midl>
    <ResourceCompile>
      <Culture>0x0804</Culture>
      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
      <AdditionalIncludeDirectories>$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
    </ResourceCompile>
  </ItemDefinitionGroup>
  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
    <ClCompile>
      <WarningLevel>Level3</WarningLevel>
      <PrecompiledHeader>Use</PrecompiledHeader>
      <Optimization>MaxSpeed</Optimization>
      <FunctionLevelLinking>true</FunctionLevelLinking>
      <IntrinsicFunctions>true</IntrinsicFunctions>
      <PreprocessorDefinitions>_WINDOWS;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
      <SDLCheck>true</SDLCheck>
    </ClCompile>
    <Link>
      <SubSystem>Windows</SubSystem>
      <GenerateDebugInformation>true</GenerateDebugInformation>
      <EnableCOMDATFolding>true</EnableCOMDATFolding>
      <OptimizeReferences>true</OptimizeReferences>
    </Link>
    <Midl>
      <MkTypLibCompatible>false</MkTypLibCompatible>
      <ValidateAllParameters>true</ValidateAllParameters>
      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
    </Midl>
    <ResourceCompile>
      <Culture>0x0804</Culture>
      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
      <AdditionalIncludeDirectories>$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
    </ResourceCompile>
  </ItemDefinitionGroup>
  <ItemGroup>
    <Text Include="ReadMe.txt" />
  </ItemGroup>
  <ItemGroup>
    <ClInclude Include="Resource.h" />
    <ClInclude Include="Servo.h" />
    <ClInclude Include="ServoDlg.h" />
    <ClInclude Include="ServoGraph.h" />
    <ClInclude Include="stdafx.h" />
    <ClInclude Include="targetver.h" />
  </ItemGroup>
  <ItemGroup>
    <ClCompile Include="Servo.cpp" />
    <ClCompile Include="ServoDlg.cpp" />
    <ClCompile Include="ServoGraph.cpp" />
    <ClCompile Include="stdafx.cpp">
      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
    </ClCompile>
  </ItemGroup>
  <ItemGroup>
    <ResourceCompile Include="Servo.rc" />
  </ItemGroup>
  <ItemGroup>
    <None Include="res\Servo.rc2" />
  </ItemGroup>
  <ItemGroup>
    <Image Include="res\Servo.ico" />
  </ItemGroup>
  <ItemGroup>
    <Manifest Include="res\application.exe.manifest" />
  </ItemGroup>
  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
  <ImportGroup Label="ExtensionTargets">
  </ImportGroup>
  <ProjectExtensions>
    <VisualStudio>
      <UserProperties RESOURCE_FILE="Servo.rc" />
    </VisualStudio>
  </ProjectExtensions>
</Project>
SourceCode/Bond/Servo/Servo.vcxproj.filters
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,72 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <ItemGroup>
    <Filter Include="源文件">
      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
      <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
    </Filter>
    <Filter Include="头文件">
      <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
      <Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
    </Filter>
    <Filter Include="资源文件">
      <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
      <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
    </Filter>
  </ItemGroup>
  <ItemGroup>
    <Text Include="ReadMe.txt" />
  </ItemGroup>
  <ItemGroup>
    <ClInclude Include="Servo.h">
      <Filter>头文件</Filter>
    </ClInclude>
    <ClInclude Include="ServoDlg.h">
      <Filter>头文件</Filter>
    </ClInclude>
    <ClInclude Include="stdafx.h">
      <Filter>头文件</Filter>
    </ClInclude>
    <ClInclude Include="targetver.h">
      <Filter>头文件</Filter>
    </ClInclude>
    <ClInclude Include="Resource.h">
      <Filter>头文件</Filter>
    </ClInclude>
    <ClInclude Include="ServoGraph.h">
      <Filter>头文件</Filter>
    </ClInclude>
  </ItemGroup>
  <ItemGroup>
    <ClCompile Include="Servo.cpp">
      <Filter>源文件</Filter>
    </ClCompile>
    <ClCompile Include="ServoDlg.cpp">
      <Filter>源文件</Filter>
    </ClCompile>
    <ClCompile Include="stdafx.cpp">
      <Filter>源文件</Filter>
    </ClCompile>
    <ClCompile Include="ServoGraph.cpp">
      <Filter>源文件</Filter>
    </ClCompile>
  </ItemGroup>
  <ItemGroup>
    <ResourceCompile Include="Servo.rc">
      <Filter>资源文件</Filter>
    </ResourceCompile>
  </ItemGroup>
  <ItemGroup>
    <None Include="res\Servo.rc2">
      <Filter>资源文件</Filter>
    </None>
  </ItemGroup>
  <ItemGroup>
    <Image Include="res\Servo.ico">
      <Filter>资源文件</Filter>
    </Image>
  </ItemGroup>
  <ItemGroup>
    <Manifest Include="res\application.exe.manifest" />
  </ItemGroup>
</Project>
SourceCode/Bond/Servo/ServoDlg.cpp
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,293 @@
// ServoDlg.cpp : å®žçŽ°æ–‡ä»¶
//
#include "stdafx.h"
#include "Servo.h"
#include "ServoDlg.h"
#include "afxdialogex.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
#define INDICATE_BONDER1        1
#define INDICATE_BONDER2        2
#define INDICATE_FLIPER            3
#define INDICATE_ALIGNER        4
#define INDICATE_LPORT4            5
#define INDICATE_LPORT3            6
#define INDICATE_LPORT2            7
#define INDICATE_LPORT1            8
#define INDICATE_ROBOT_ARM1        9
#define INDICATE_ROBOT_ARM2        10
#define INDICATE_VACUUM_BAKE    11
#define INDICATE_BAKE_COOLING    12
#define INDICATE_MEASUREMENT    13
// ç”¨äºŽåº”用程序“关于”菜单项的 CAboutDlg å¯¹è¯æ¡†
class CAboutDlg : public CDialogEx
{
public:
    CAboutDlg();
// å¯¹è¯æ¡†æ•°æ®
#ifdef AFX_DESIGN_TIME
    enum { IDD = IDD_ABOUTBOX };
#endif
    protected:
    virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV æ”¯æŒ
// å®žçް
protected:
    DECLARE_MESSAGE_MAP()
};
CAboutDlg::CAboutDlg() : CDialogEx(IDD_ABOUTBOX)
{
}
void CAboutDlg::DoDataExchange(CDataExchange* pDX)
{
    CDialogEx::DoDataExchange(pDX);
}
BEGIN_MESSAGE_MAP(CAboutDlg, CDialogEx)
END_MESSAGE_MAP()
// CServoDlg å¯¹è¯æ¡†
CServoDlg::CServoDlg(CWnd* pParent /*=NULL*/)
    : CDialogEx(IDD_SERVO_DIALOG, pParent)
{
    m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
    m_crBkgnd = RGB(255, 255, 255);
    m_hbrBkgnd = nullptr;
}
void CServoDlg::DoDataExchange(CDataExchange* pDX)
{
    CDialogEx::DoDataExchange(pDX);
}
BEGIN_MESSAGE_MAP(CServoDlg, CDialogEx)
    ON_WM_SYSCOMMAND()
    ON_WM_PAINT()
    ON_WM_QUERYDRAGICON()
    ON_BN_CLICKED(IDOK, &CServoDlg::OnBnClickedOk)
    ON_BN_CLICKED(IDCANCEL, &CServoDlg::OnBnClickedCancel)
    ON_WM_CTLCOLOR()
    ON_WM_DESTROY()
END_MESSAGE_MAP()
// CServoDlg æ¶ˆæ¯å¤„理程序
BOOL CServoDlg::OnInitDialog()
{
    CDialogEx::OnInitDialog();
    // å°†â€œå…³äºŽ...”菜单项添加到系统菜单中。
    // IDM_ABOUTBOX å¿…须在系统命令范围内。
    ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);
    ASSERT(IDM_ABOUTBOX < 0xF000);
    CMenu* pSysMenu = GetSystemMenu(FALSE);
    if (pSysMenu != NULL)
    {
        BOOL bNameValid;
        CString strAboutMenu;
        bNameValid = strAboutMenu.LoadString(IDS_ABOUTBOX);
        ASSERT(bNameValid);
        if (!strAboutMenu.IsEmpty())
        {
            pSysMenu->AppendMenu(MF_SEPARATOR);
            pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);
        }
    }
    // è®¾ç½®æ­¤å¯¹è¯æ¡†çš„图标。  å½“应用程序主窗口不是对话框时,框架将自动
    //  æ‰§è¡Œæ­¤æ“ä½œ
    SetIcon(m_hIcon, TRUE);            // è®¾ç½®å¤§å›¾æ ‡
    SetIcon(m_hIcon, FALSE);        // è®¾ç½®å°å›¾æ ‡
    // Í¼Ê¾
    m_pGraph = CServoGraph::Hook(GetDlgItem(IDC_SERVO_GRAPH1)->GetSafeHwnd());
    CString strPath;
    strPath.Format(_T("%s\\res\\Servo001.bmp"), (LPTSTR)(LPCTSTR)theApp.m_strAppDir);
    m_pGraph->AddImage(1, (LPTSTR)(LPCTSTR)strPath, 0, 0);
    // æ·»åŠ æŒ‡ç¤ºå™¨
    // Bonder
    m_pGraph->AddIndicateBox(INDICATE_BONDER1, 220, 172, 48, RGB(22, 22, 22),
        RGB(255, 127, 39), RGB(0, 176, 80));
    m_pGraph->SetBoxText(INDICATE_BONDER1, "10", "Bonder 1");
    m_pGraph->AddIndicateBox(INDICATE_BONDER2, 220, 516, 48, RGB(22, 22, 22),
        RGB(255, 127, 39), RGB(0, 176, 80));
    m_pGraph->SetBoxText(INDICATE_BONDER2, "11", "Bonder 2");
    // ç¿»è½¬
    m_pGraph->AddIndicateBox(INDICATE_FLIPER, 338, 172, 48, RGB(22, 22, 22),
        RGB(255, 127, 39), RGB(0, 176, 80));
    m_pGraph->SetBoxText(INDICATE_FLIPER, "8", "Fliper");
    // å¯¹ä½
    m_pGraph->AddIndicateBox(INDICATE_ALIGNER, 428, 172, 48, RGB(22, 22, 22),
        RGB(255, 127, 39), RGB(0, 176, 80));
    m_pGraph->SetBoxText(INDICATE_ALIGNER, "7", "Aligner");
    // Load port 4
    m_pGraph->AddIndicateBox(INDICATE_LPORT4, 518, 172, 48, RGB(22, 22, 22),
        RGB(255, 127, 39), RGB(0, 176, 80));
    m_pGraph->SetBoxText(INDICATE_LPORT4, "4", "LPort4");
    // Load port 3
    m_pGraph->AddIndicateBox(INDICATE_LPORT3, 606, 172, 48, RGB(22, 22, 22),
        RGB(255, 127, 39), RGB(0, 176, 80));
    m_pGraph->SetBoxText(INDICATE_LPORT3, "3", "LPort3");
    // Load port 2
    m_pGraph->AddIndicateBox(INDICATE_LPORT2, 690, 172, 48, RGB(22, 22, 22),
        RGB(255, 127, 39), RGB(0, 176, 80));
    m_pGraph->SetBoxText(INDICATE_LPORT2, "2", "LPort2");
    // Load port 1
    m_pGraph->AddIndicateBox(INDICATE_LPORT1, 774, 172, 48, RGB(22, 22, 22),
        RGB(255, 127, 39), RGB(0, 176, 80));
    m_pGraph->SetBoxText(INDICATE_LPORT1, "1", "LPort1");
    // Robot
    m_pGraph->AddIndicateBox(INDICATE_ROBOT_ARM1, 620, 294, 48, RGB(22, 22, 22),
        RGB(255, 127, 39), RGB(0, 176, 80));
    m_pGraph->SetBoxText(INDICATE_ROBOT_ARM1, "5", "Robot");
    m_pGraph->AddIndicateBox(INDICATE_ROBOT_ARM2, 673, 294, 48, RGB(22, 22, 22),
        RGB(255, 127, 39), RGB(0, 176, 80));
    m_pGraph->SetBoxText(INDICATE_ROBOT_ARM2, "6", "Robot");
    // Vacuum bake
    m_pGraph->AddIndicateBox(INDICATE_VACUUM_BAKE, 396, 516, 48, RGB(22, 22, 22),
        RGB(255, 127, 39), RGB(0, 176, 80));
    m_pGraph->SetBoxText(INDICATE_VACUUM_BAKE, "9", "Vacuum bake");
    // Bake cooling
    m_pGraph->AddIndicateBox(INDICATE_BAKE_COOLING, 566, 516, 48, RGB(22, 22, 22),
        RGB(255, 127, 39), RGB(0, 176, 80));
    m_pGraph->SetBoxText(INDICATE_BAKE_COOLING, "12", "Bake cooling");
    // Bake cooling
    m_pGraph->AddIndicateBox(INDICATE_MEASUREMENT, 736, 516, 48, RGB(22, 22, 22),
        RGB(255, 127, 39), RGB(0, 176, 80));
    m_pGraph->SetBoxText(INDICATE_MEASUREMENT, "13", "Measurement");
    return TRUE;  // é™¤éžå°†ç„¦ç‚¹è®¾ç½®åˆ°æŽ§ä»¶ï¼Œå¦åˆ™è¿”回 TRUE
}
void CServoDlg::OnSysCommand(UINT nID, LPARAM lParam)
{
    if ((nID & 0xFFF0) == IDM_ABOUTBOX)
    {
        CAboutDlg dlgAbout;
        dlgAbout.DoModal();
    }
    else
    {
        CDialogEx::OnSysCommand(nID, lParam);
    }
}
// å¦‚果向对话框添加最小化按钮,则需要下面的代码
//  æ¥ç»˜åˆ¶è¯¥å›¾æ ‡ã€‚  å¯¹äºŽä½¿ç”¨æ–‡æ¡£/视图模型的 MFC åº”用程序,
//  è¿™å°†ç”±æ¡†æž¶è‡ªåŠ¨å®Œæˆã€‚
void CServoDlg::OnPaint()
{
    if (IsIconic())
    {
        CPaintDC dc(this); // ç”¨äºŽç»˜åˆ¶çš„设备上下文
        SendMessage(WM_ICONERASEBKGND, reinterpret_cast<WPARAM>(dc.GetSafeHdc()), 0);
        // ä½¿å›¾æ ‡åœ¨å·¥ä½œåŒºçŸ©å½¢ä¸­å±…中
        int cxIcon = GetSystemMetrics(SM_CXICON);
        int cyIcon = GetSystemMetrics(SM_CYICON);
        CRect rect;
        GetClientRect(&rect);
        int x = (rect.Width() - cxIcon + 1) / 2;
        int y = (rect.Height() - cyIcon + 1) / 2;
        // ç»˜åˆ¶å›¾æ ‡
        dc.DrawIcon(x, y, m_hIcon);
    }
    else
    {
        CDialogEx::OnPaint();
    }
}
//当用户拖动最小化窗口时系统调用此函数取得光标
//显示。
HCURSOR CServoDlg::OnQueryDragIcon()
{
    return static_cast<HCURSOR>(m_hIcon);
}
void CServoDlg::OnBnClickedOk()
{
    // TODO: åœ¨æ­¤æ·»åŠ æŽ§ä»¶é€šçŸ¥å¤„ç†ç¨‹åºä»£ç 
    CDialogEx::OnOK();
}
void CServoDlg::OnBnClickedCancel()
{
    // TODO: åœ¨æ­¤æ·»åŠ æŽ§ä»¶é€šçŸ¥å¤„ç†ç¨‹åºä»£ç 
    CDialogEx::OnCancel();
}
HBRUSH CServoDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
    HBRUSH hbr = CDialogEx::OnCtlColor(pDC, pWnd, nCtlColor);
    if (nCtlColor == CTLCOLOR_STATIC) {
        pDC->SetBkColor(m_crBkgnd);
        pDC->SetTextColor(RGB(0, 0, 0));
    }
    if (m_hbrBkgnd == nullptr) {
        m_hbrBkgnd = CreateSolidBrush(m_crBkgnd);
    }
    return m_hbrBkgnd;
}
void CServoDlg::OnDestroy()
{
    CDialogEx::OnDestroy();
    if (m_hbrBkgnd != nullptr) {
        ::DeleteObject(m_hbrBkgnd);
    }
}
SourceCode/Bond/Servo/ServoDlg.h
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,43 @@
// ServoDlg.h : å¤´æ–‡ä»¶
//
#pragma once
#include "ServoGraph.h"
// CServoDlg å¯¹è¯æ¡†
class CServoDlg : public CDialogEx
{
// æž„造
public:
    CServoDlg(CWnd* pParent = NULL);    // æ ‡å‡†æž„造函数
// å¯¹è¯æ¡†æ•°æ®
#ifdef AFX_DESIGN_TIME
    enum { IDD = IDD_SERVO_DIALOG };
#endif
    protected:
    virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV æ”¯æŒ
// å®žçް
protected:
    HICON m_hIcon;
    CServoGraph* m_pGraph;
    COLORREF m_crBkgnd;
    HBRUSH m_hbrBkgnd;
    // ç”Ÿæˆçš„æ¶ˆæ¯æ˜ å°„函数
    virtual BOOL OnInitDialog();
    afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
    afx_msg void OnPaint();
    afx_msg HCURSOR OnQueryDragIcon();
    DECLARE_MESSAGE_MAP()
public:
    afx_msg void OnBnClickedOk();
    afx_msg void OnBnClickedCancel();
    afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor);
    afx_msg void OnDestroy();
};
SourceCode/Bond/Servo/ServoGraph.cpp
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,629 @@
// ServoGraph.cpp: implementation of the CServoGraph class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "ServoGraph.h"
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
CServoGraph::CServoGraph()
{
    m_hWnd = NULL;
    m_crBkgnd = RGB(255,255,255);
    m_pHighItem = nullptr;
    m_hWndTooltip = nullptr;
}
CServoGraph::~CServoGraph()
{
    for (auto& item : m_images) {
        if (item.hBitmap != nullptr) {
            ::DeleteObject(item.hBitmap);
        }
    }
}
BOOL CServoGraph::RegisterWndClass()
{
    WNDCLASS wc;
    wc.lpszClassName = BYSERVOGRAPH_CLASS;
    wc.hInstance = AfxGetInstanceHandle();
    wc.lpfnWndProc = WindowProc;
    wc.hCursor = ::LoadCursor(NULL, IDC_ARROW);
    wc.hIcon = 0;
    wc.lpszMenuName = NULL;
    wc.hbrBackground = NULL;
    wc.style = CS_GLOBALCLASS|CS_DBLCLKS;
    wc.cbClsExtra = 0;
    wc.cbWndExtra = 0;
    // æ³¨å†Œè‡ªå®šä¹‰ç±»
    return (::RegisterClass(&wc) != 0);
}
CServoGraph* CServoGraph::Hook(HWND hWnd)
{
    CServoGraph* pServoGraph = (CServoGraph*)GetProp(hWnd, BYSTAG_SERVOGRAPH);
    if(pServoGraph == NULL)
    {
        pServoGraph = new CServoGraph;
        pServoGraph->m_hWnd = hWnd;
        SetProp(hWnd, BYSTAG_SERVOGRAPH, (HANDLE)pServoGraph);
    }
    return pServoGraph;
}
void CServoGraph::Release()
{
    if (m_hWndTooltip != NULL) {
        ::DestroyWindow(m_hWndTooltip);
        m_hWndTooltip = NULL;
    }
    // delete
    delete this;
}
void CServoGraph::Notify(int nCode, int dwData, int dwData1/* = 0*/, int dwData2/* = 0*/)
{
    HWND hParent;
    hParent = GetParent(m_hWnd);
    if(hParent != NULL) {
        BYSERVOGRAPH_NMHDR iii_nmhdr;
        iii_nmhdr.nmhdr.hwndFrom = m_hWnd;
        iii_nmhdr.nmhdr.idFrom = GetWindowLong(m_hWnd, GWL_ID);
        iii_nmhdr.nmhdr.code = nCode;
        iii_nmhdr.dwData = dwData;
        iii_nmhdr.dwData1 = dwData1;
        iii_nmhdr.dwData2 = dwData2;
        SendMessage(hParent, WM_NOTIFY, (WPARAM)iii_nmhdr.nmhdr.idFrom, (LPARAM)&iii_nmhdr);
    }
}
////////////////////////////////
// æ‹¦æˆªçª—口消息函数
LRESULT CALLBACK CServoGraph::WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
    CServoGraph* pServoGraph = (CServoGraph *)GetProp(hWnd, BYSTAG_SERVOGRAPH);
    if(pServoGraph == NULL && uMsg != WM_NCCREATE)
    {
        return ::DefWindowProc(hWnd, uMsg, wParam, lParam);
    }
    // å¦‚æžœHook则响应消息
    ASSERT(hWnd);
    switch(uMsg)
    {
    case WM_NCCREATE:
        return OnNcCreate(hWnd, wParam, lParam);
    case WM_DESTROY:
        return pServoGraph->OnDestroy(wParam, lParam);
    case WM_PAINT:
        return pServoGraph->OnPaint(wParam, lParam);
    case WM_TIMER:
        return pServoGraph->OnTimer(wParam, lParam);
    case WM_MOUSEMOVE:
        return pServoGraph->OnMouseMove(wParam, lParam);
    case WM_LBUTTONDOWN:
        return pServoGraph->OnLButtonDown(wParam, lParam);
    case WM_GETDLGCODE:
        return DLGC_WANTALLKEYS;
    default:
        break;
    }
    return ::DefWindowProc(hWnd, uMsg, wParam, lParam);
}
///////////////////////////////
// WM_NCCREATE
// çª—口创建前的初始化工作
LRESULT CServoGraph::OnNcCreate(HWND hWnd, WPARAM wParam, LPARAM lParam)
{
    CServoGraph* pServoGraph = (CServoGraph *)GetProp(hWnd, BYSTAG_SERVOGRAPH);
    ASSERT(pServoGraph == NULL);
    Hook(hWnd);
    return ::DefWindowProc(hWnd, WM_NCCREATE, wParam, lParam);
}
///////////////////////////////
// WM_DESTROY
LRESULT CServoGraph::OnDestroy(WPARAM wParam, LPARAM lParam)
{
    Release();
    return ::DefWindowProc(m_hWnd, WM_DESTROY, wParam, lParam);
}
///////////////////////////////
// WM_TIMER
LRESULT CServoGraph::OnTimer(WPARAM wParam, LPARAM lParam)
{
    if (wParam == 1) {
        POINT pt;
        GetCursorPos(&pt);
        ::ScreenToClient(m_hWnd, &pt);
        void* pLastHighItem = m_pHighItem;
        int nHitCode = HitTest(pt, m_pHighItem);
        if (m_pHighItem != pLastHighItem) {
            ::InvalidateRect(m_hWnd, NULL, TRUE);
        }
        if (m_pHighItem == nullptr) {
            ::KillTimer(m_hWnd, 1);
        }
    }
    return ::DefWindowProc(m_hWnd, WM_TIMER, wParam, lParam);
}
///////////////////////////////
// WM_MOUSEMOVE
LRESULT CServoGraph::OnMouseMove(WPARAM wParam, LPARAM lParam)
{
    POINT pt;
    pt.x = LOWORD(lParam);
    pt.y = HIWORD(lParam);
    void* pLastHighItem = m_pHighItem;
    int nHitCode = HitTest(pt, m_pHighItem);
    if (m_pHighItem != pLastHighItem) {
        ::InvalidateRect(m_hWnd, NULL, TRUE);
    }
    if (m_pHighItem != NULL) {
        ::KillTimer(m_hWnd, 1);
        ::SetTimer(m_hWnd, 1, 100, NULL);
    }
    return ::DefWindowProc(m_hWnd, WM_MOUSEMOVE, wParam, lParam);
}
/*
 * WM_LBUTTONDOWN
 * é¼ æ ‡å·¦é”®æŒ‰ä¸‹
 */
LRESULT CServoGraph::OnLButtonDown(WPARAM wParam, LPARAM lParam)
{
    POINT pt, ptNew;
    pt.x = LOWORD(lParam);
    pt.y = HIWORD(lParam);
    BOOL bButtonUp = FALSE;
    int nClickIndex = -1;
    void* pPressItem = nullptr;
    void* pTempItem = nullptr;
    HitTest(pt, pPressItem);
    // æ•捉鼠标消息,检测是否拖动
    if (pPressItem != NULL) {
        ::KillTimer(m_hWnd, 1);
        if (::GetCapture() == NULL) {
            SetCapture(m_hWnd);
            ASSERT(m_hWnd == GetCapture());
            AfxLockTempMaps();
            for (;;)
            {
                MSG msg;
                VERIFY(::GetMessage(&msg, NULL, 0, 0));
                if (GetCapture() != m_hWnd) break;
                switch (msg.message)
                {
                case WM_MOUSEMOVE:
                    break;
                case WM_LBUTTONUP:
                    ptNew = msg.pt;
                    ::ScreenToClient(m_hWnd, &ptNew);
                    HitTest(ptNew, pTempItem);
                    if (pPressItem == pTempItem) {
                        bButtonUp = TRUE;
                    }
                    goto ExitLoop;
                case WM_KEYDOWN:
                    if (msg.wParam == VK_ESCAPE) {
                        goto ExitLoop;
                    }
                    break;
                default:
                    DispatchMessage(&msg);
                    break;
                }
            }
        ExitLoop:
            ReleaseCapture();
            ::InvalidateRect(m_hWnd, NULL, TRUE);
            if (bButtonUp) {
                Notify((int)BYSERVOGRAPH_ITEM_CLICKED, ((INDICATEBOX*)pPressItem)->id);
            }
            AfxUnlockTempMaps(FALSE);
        }
    }
    return ::DefWindowProc(m_hWnd, WM_LBUTTONDOWN, wParam, lParam);
}
///////////////////////////////
// WM_PAINT
LRESULT CServoGraph::OnPaint(WPARAM wParam, LPARAM lParam)
{
    HDC hDC, hMemDC;
    HBITMAP hBitmap;
    RECT rcClient;
    CString strText;
    HFONT hFont;
    HBRUSH hBrushBK;
    // BeginPaint
    PAINTSTRUCT ps;
    hDC = BeginPaint(m_hWnd, &ps);
    GetClientRect(m_hWnd, &rcClient);
    hMemDC = ::CreateCompatibleDC(hDC);
    hBitmap = ::CreateCompatibleBitmap(hDC, rcClient.right-rcClient.left,
        rcClient.bottom-rcClient.top);
    ::SelectObject(hMemDC, hBitmap);
    hFont = (HFONT)GetStockObject(DEFAULT_GUI_FONT);
    ::SelectObject(hMemDC, hFont);
    // èƒŒæ™¯é¢œè‰²
    hBrushBK = CreateSolidBrush( m_crBkgnd );
    ::FillRect(hMemDC, &rcClient, hBrushBK);
    DeleteObject(hBrushBK);
    // ç”»IMAGE
    HDC hDCTemp = ::CreateCompatibleDC(hMemDC);
    for (auto& item : m_images) {
        // è½½å…¥BMP
        if (item.hBitmap == nullptr) {
            item.hBitmap = (HBITMAP)LoadImage(AfxGetInstanceHandle(),
                item.szPath, IMAGE_BITMAP, 0, 0,
                LR_CREATEDIBSECTION | LR_DEFAULTSIZE | LR_LOADFROMFILE);
            if (item.hBitmap != nullptr) {
                BITMAP bitmap;
                ::GetObject(item.hBitmap, sizeof(BITMAP), &bitmap);
                item.bmWidth = bitmap.bmWidth;
                item.bmHeight = bitmap.bmHeight;
            }
        }
        if (item.hBitmap != nullptr) {
            ::SelectObject(hDCTemp, item.hBitmap);
            ::BitBlt(hMemDC, item.x, item.y, item.bmWidth, item.bmHeight,
                hDCTemp, 0, 0, SRCCOPY);
        }
    }
    ::DeleteDC(hDCTemp);
    // ç”»èƒŒæ™¯æŒ‡ç¤º
    for (auto& item : m_indicateBkgnds) {
        HBRUSH hbrBkgnd = CreateSolidBrush(item.backgroundColor);
        ::FillRect(hMemDC, &item.rect, hbrBkgnd);
        ::DeleteObject(hbrBkgnd);
    }
    // ç”»æŒ‡ç¤ºæ¡†
    ::SetBkMode(hMemDC, TRANSPARENT);
    for (auto& item : m_indicateBoxs) {
        RECT rcItem;
        rcItem.left = item.x - item.box1Width / 2;
        rcItem.top = item.y - item.box1Width / 2;
        rcItem.right = rcItem.left + item.box1Width;
        rcItem.bottom = rcItem.top + item.box1Width;
        HBRUSH hbrFrame = CreateSolidBrush(m_pHighItem == &item ? item.box1FrameColor[1] : item.box1FrameColor[0]);
        HBRUSH hbrBkgnd = CreateSolidBrush(item.box1BackgroundColor);
        ::FillRect(hMemDC, &rcItem, hbrBkgnd);
        ::FrameRect(hMemDC, &rcItem, hbrFrame);
        ::DeleteObject(hbrBkgnd);
        ::DeleteObject(hbrFrame);
        if (item.bBox2Visible) {
            rcItem.left = item.x - item.box2Width / 2;
            rcItem.top = item.y - item.box2Width / 2;
            rcItem.right = rcItem.left + item.box2Width;
            rcItem.bottom = rcItem.top + item.box2Width;
            hbrFrame = CreateSolidBrush(item.box2FrameColor);
            hbrBkgnd = CreateSolidBrush(item.box2BackgroundColor);
            ::FillRect(hMemDC, &rcItem, hbrBkgnd);
            ::FrameRect(hMemDC, &rcItem, hbrFrame);
            ::DeleteObject(hbrBkgnd);
            ::DeleteObject(hbrFrame);
        }
        // text
        ::DrawText(hMemDC, item.szText, strlen(item.szText),
            &rcItem, DT_CENTER | DT_VCENTER | DT_SINGLELINE | DT_END_ELLIPSIS);
    }
    // EndPaint
    ::BitBlt(hDC, 0, 0, rcClient.right-rcClient.left, rcClient.bottom-rcClient.top,
        hMemDC, 0, 0, SRCCOPY);
    EndPaint(m_hWnd, &ps);
    ::DeleteObject(hBitmap);
    ::DeleteDC(hMemDC);
    return 1;
}
void CServoGraph::SetBkgndColor(COLORREF cr)
{
    m_crBkgnd = cr;
}
void CServoGraph::SetResDir(CString strDir)
{
    m_strResDir = strDir;
}
void CServoGraph::AddImage(int id, char* pszPath, int x, int y)
{
    if (GetImage(id) != nullptr) return;
    IMAGE image;
    memset(&image, 0, sizeof(IMAGE));
    image.id = id;
    strcpy_s(image.szPath, MAX_PATH, pszPath);
    image.x = x;
    image.y = y;
    m_images.push_back(image);
}
CServoGraph::IMAGE* CServoGraph::GetImage(int id)
{
    for (auto& item : m_images) {
        if (item.id == id) return &item;
    }
    return nullptr;
}
void CServoGraph::AddIndicateBox(int id, int x, int y, int width)
{
    INDICATEBOX ib;
    ib.id = id;
    ib.x = x;
    ib.y = y;
    ib.box1Width = width;
    ib.box1FrameColor[0] = RGB(22, 22, 22);
    ib.box1FrameColor[1] = RGB(255, 127, 39);
    ib.box1BackgroundColor = RGB(245, 245, 245);
    ib.box2Width = width - 10;
    m_indicateBoxs.push_back(ib);
}
void CServoGraph::AddIndicateBox(int id, int x, int y, int width,
    COLORREF crFrame1, COLORREF crFrame2, COLORREF crBackground)
{
    INDICATEBOX ib;
    ib.id = id;
    ib.x = x;
    ib.y = y;
    ib.box1Width = width;
    ib.box1FrameColor[0] = crFrame1;
    ib.box1FrameColor[1] = crFrame2;
    ib.box1BackgroundColor = crBackground;
    ib.box2Width = width - 10;
    m_indicateBoxs.push_back(ib);
}
void CServoGraph::AddIndicateBoxContext(int id, void* pContext)
{
    INDICATEBOX* pib = GetIndicateBox(id);
    if (pib != nullptr) {
        pib->m_contexts.push_back(pContext);
    }
}
BOOL CServoGraph::RemoveIndicateBoxContext(int id, void* pContext)
{
    INDICATEBOX* pib = GetIndicateBox(id);
    if (pib != nullptr) {
        for (auto iter = pib->m_contexts.begin(); iter != pib->m_contexts.end(); iter++) {
            if ((*iter) == pContext) {
                pib->m_contexts.erase(iter);
                return TRUE;
            }
        }
    }
    return FALSE;
}
BOOL CServoGraph::RemoveIndicateBoxAllContext(int id)
{
    INDICATEBOX* pib = GetIndicateBox(id);
    if (pib != nullptr) {
        pib->m_contexts.clear();
        return TRUE;
    }
    return FALSE;
}
const std::vector<void*>& CServoGraph::GetIndicateBoxContexts(int id)
{
    static std::vector<void*> empty;
    INDICATEBOX* pib = GetIndicateBox(id);
    if (pib == nullptr) return empty;
    return pib->m_contexts;
}
bool CServoGraph::IsIndicateBoxContextsEmpty(int id)
{
    INDICATEBOX* pib = GetIndicateBox(id);
    if (pib != nullptr) {
        return pib->m_contexts.empty();
    }
    return true;
}
void CServoGraph::ShowIndicateBoxInterior(int id, COLORREF color)
{
    INDICATEBOX* pib = GetIndicateBox(id);
    if (pib != nullptr) {
        pib->bBox2Visible = true;
        pib->box2FrameColor = RGB(128, 128, 128);
        pib->box2BackgroundColor = color;
        InvalidateRect(m_hWnd, NULL, TRUE);
    }
}
void CServoGraph::HideIndicateBoxInterior(int id)
{
    INDICATEBOX* pib = GetIndicateBox(id);
    if (pib != nullptr) {
        pib->bBox2Visible = false;
        InvalidateRect(m_hWnd, NULL, TRUE);
    }
}
CServoGraph::INDICATEBOX* CServoGraph::GetIndicateBox(int id)
{
    for (auto& item : m_indicateBoxs) {
        if (item.id == id) return &item;
    }
    return nullptr;
}
void CServoGraph::AddIndicateBkgnd(int id, int left, int top, int width, int height, COLORREF color)
{
    INDICATEBKGND ibk;
    ibk.id = id;
    ibk.rect.left = left;
    ibk.rect.top = top;
    ibk.rect.right = ibk.rect.left + width;
    ibk.rect.bottom = ibk.rect.top + height;;
    ibk.backgroundColor = color;
    m_indicateBkgnds.push_back(ibk);
}
void CServoGraph::SetIndicateBkgndColor(int id, COLORREF color)
{
    INDICATEBKGND* pibk = GetIndicateBkgnd(id);
    if (pibk != nullptr) {
        pibk->backgroundColor = color;
        InvalidateRect(m_hWnd, nullptr, TRUE);
    }
}
CServoGraph::INDICATEBKGND* CServoGraph::GetIndicateBkgnd(int id)
{
    for (auto& item : m_indicateBkgnds) {
        if (item.id == id) return &item;
    }
    return nullptr;
}
/*
 * æ£€æµ‹åæ ‡ç‚¹æ‰€åœ¨çš„项
 * è¿”回, TYGTLITEM
 */
int CServoGraph::HitTest(POINT pt, OUT void*& pItem)
{
    // æ£€æµ‹æ˜¯å¦åœ¨æŸä¸ªå­é¡¹
    int nRet = HMGRAPH_HT_NOWHERE;
    pItem = NULL;
    RECT rcItem;
    for (int i = 0; i < m_indicateBoxs.size(); i++) {
        auto& item = m_indicateBoxs.at(i);
        GetIndicateBoxRect(&item, &rcItem);
        if (::PtInRect(&rcItem, pt)) {
            pItem = &item;
            nRet = HMGRAPH_HT_ITEM;
            break;
        }
    }
    return nRet;
}
void CServoGraph::GetIndicateBoxRect(INDICATEBOX* pBox, LPRECT lprcBox)
{
    lprcBox->left = pBox->x - pBox->box1Width / 2;
    lprcBox->top = pBox->y - pBox->box1Width / 2;
    lprcBox->right = lprcBox->left + pBox->box1Width;
    lprcBox->bottom = lprcBox->top + pBox->box1Width;
}
BOOL CServoGraph::GetIndicateBoxRect(int id, LPRECT lprcBox)
{
    INDICATEBOX* pBox = GetIndicateBox(id);
    if (pBox == nullptr) return FALSE;
    GetIndicateBoxRect(pBox, lprcBox);
    return TRUE;
}
HWND CServoGraph::GetSafeWnd()
{
    return m_hWnd;
}
void CServoGraph::SetBoxText(int id, const char* pszText, const char* pszTooltip)
{
    if (m_hWndTooltip == NULL) {
        m_hWndTooltip = CreateWindowEx(WS_EX_TOPMOST, TOOLTIPS_CLASS,
            NULL, WS_POPUP | TTS_NOPREFIX | TTS_ALWAYSTIP,
            CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
            m_hWnd, NULL, NULL, NULL);
        ::SendMessage(m_hWndTooltip, TTM_SETMAXTIPWIDTH, 0, 500);
    }
    INDICATEBOX* pBox = GetIndicateBox(id);
    if (pBox != nullptr) {
        strcpy_s(pBox->szText, sizeof(pBox->szText), pszText);
        // tooltip
        TOOLINFO    tti;
        memset(&tti, 0, sizeof(TOOLINFO));
        tti.cbSize = sizeof(TOOLINFO);
        tti.uFlags = TTF_SUBCLASS;
        tti.hwnd = m_hWnd;
        GetIndicateBoxRect(pBox, &tti.rect);
        tti.uId = id;
        tti.lpszText = (LPSTR)pszTooltip;
        SendMessage(m_hWndTooltip, TTM_ADDTOOL, 0, (LPARAM)(LPTOOLINFO)&tti);
    }
}
SourceCode/Bond/Servo/ServoGraph.h
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,183 @@
// ServoGraph.h: interface for the CServoGraph class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_SERVOGRAPH_H__FBB8916A_DE77_4EA3_9C21_E51E6B06194C__INCLUDED_)
#define AFX_vGRAPH_H__FBB8916A_DE77_4EA3_9C21_E51E6B06194C__INCLUDED_
#pragma comment(lib, "Msimg32.lib")            // TransparentBlt
#include <vector>
//====== ServoGraph =====================================================
#ifndef NOSERVOGRAPH
#ifdef _WIN32
#define BYSERVOGRAPH_CLASSA       "BYServoGraph"
#define BYSERVOGRAPH_CLASSW       L"BYServoGraph"
#ifdef UNICODE
#define  BYSERVOGRAPH_CLASS       BYSERVOGRAPH_CLASSW
#else
#define  BYSERVOGRAPH_CLASS       BYSERVOGRAPH_CLASSA
#endif
#else
#define BYSERVOGRAPH_CLASS        "BYSERVOGraph"
#endif
#define BYSTAG_SERVOGRAPH         _T("ISSERVOGRAPH")
//====== WM_NOTIFY codes (NMHDR.code values) ==================================
#define BYSERVOGRAPH_FIRST                 (0U-1390U)       //
#define BYSERVOGRAPH_LAST                 (0U-1350U)
#define BYSERVOGRAPH_ITEM_CLICKED          (BYSERVOGRAPH_FIRST - 1)
typedef struct tagBYSERVOGRAPH_NMHDR
{
    NMHDR        nmhdr;
    DWORD        dwData;
    DWORD        dwData1;
    DWORD        dwData2;
} BYSERVOGRAPH_NMHDR;
#endif
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#define HMGRAPH_HITCODETEST            _T("HitCode")
#define HMGRAPH_HT_NOWHERE            0x1
#define HMGRAPH_HT_ITEM                0x2
class CServoGraph
{
private:
    typedef struct tagIMAGE
    {
        int id;
        char szPath[MAX_PATH];
        int x;
        int y;
        HBITMAP hBitmap;
        int bmWidth;
        int bmHeight;
    } IMAGE;
    class INDICATEBOX
    {
    public:
        INDICATEBOX() {
            this->id = 0;
            this->x = 0;
            this->y = 0;
            this->box1Width = 0;
            this->box1BackgroundColor = RGB(255, 255, 255);
            this->box1FrameColor[0] = RGB(22, 22, 22);
            this->box1FrameColor[1] = RGB(22, 22, 22);
            this->box2Width = 0;
            this->box2BackgroundColor = RGB(0, 255, 255);;
            this->box2FrameColor = RGB(255, 255, 0);;
            this->bBox2Visible = FALSE;
        };
        ~INDICATEBOX() {};
    public:
        int id;
        int x;
        int y;
        int box1Width;
        COLORREF box1BackgroundColor;
        COLORREF box1FrameColor[2];
        char szText[64];
        int box2Width;
        COLORREF box2BackgroundColor;
        COLORREF box2FrameColor;
        BOOL bBox2Visible;
        std::vector<void*> m_contexts;
    };
    class INDICATEBKGND
    {
    public:
        INDICATEBKGND() {
            this->id = 0;
            this->rect = { 0, 0, 10, 10 };
            this->backgroundColor = RGB(255, 255, 255);;
        };
        ~INDICATEBKGND() {};
    public:
        int id;
        RECT rect;
        COLORREF backgroundColor;
    };
public:
    CServoGraph();
    virtual ~CServoGraph();
    static BOOL RegisterWndClass();
    static CServoGraph* Hook(HWND hWnd);
    void Notify(int nCode, int dwData, int dwData1 = 0, int dwData2 = 0);
    void Release();
    void SetBkgndColor(COLORREF cr);
    static LRESULT CALLBACK WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
    static LRESULT OnNcCreate(HWND hWnd, WPARAM wParam, LPARAM lParam);
    LRESULT OnDestroy(WPARAM wParam, LPARAM lParam);
    LRESULT OnTimer(WPARAM wParam, LPARAM lParam);
    LRESULT OnPaint(WPARAM wParam, LPARAM lParam);
    LRESULT OnMouseMove(WPARAM wParam, LPARAM lParam);
    LRESULT OnLButtonDown(WPARAM wParam, LPARAM lParam);
public:
    void AddImage(int id, char* pszPath, int x, int y);
    void AddIndicateBox(int id, int x, int y, int width);
    void AddIndicateBox(int id, int x, int y, int width,
        COLORREF crFrame1, COLORREF crFrame2, COLORREF crBackground);
    void AddIndicateBoxContext(int id, void* pContext);
    BOOL RemoveIndicateBoxContext(int id, void* pContext);
    BOOL RemoveIndicateBoxAllContext(int id);
    const std::vector<void*>& GetIndicateBoxContexts(int id);
    bool IsIndicateBoxContextsEmpty(int id);
    void ShowIndicateBoxInterior(int id, COLORREF color);
    void HideIndicateBoxInterior(int id);
    CServoGraph::INDICATEBOX* GetIndicateBox(int id);
    void AddIndicateBkgnd(int id, int left, int top, int width, int height, COLORREF color);
    void SetIndicateBkgndColor(int id, COLORREF color);
    CServoGraph::INDICATEBKGND* GetIndicateBkgnd(int id);
    void SetResDir(CString strDir);
    CServoGraph::IMAGE* GetImage(int id);
    int HitTest(POINT pt, OUT void*& pItem);
    void GetIndicateBoxRect(INDICATEBOX* pBox, LPRECT lprcBox);
    BOOL GetIndicateBoxRect(int id, LPRECT lprcBox);
    void SetBoxText(int id, const char* pszText, const char* pszTooltip);
    HWND GetSafeWnd();
private:
    HWND        m_hWnd;
    COLORREF m_crBkgnd;
    CString m_strResDir;
private:
    std::vector<IMAGE> m_images;
    std::vector<INDICATEBOX> m_indicateBoxs;
    std::vector<INDICATEBKGND> m_indicateBkgnds;
    void* m_pHighItem;
    HWND m_hWndTooltip;
};
#endif // !defined(AFX_EQUIPMENTGRAPH_H__FBB8916A_DE77_4EA3_9C21_E51E6B06194C__INCLUDED_)
SourceCode/Bond/Servo/res/Servo.ico
SourceCode/Bond/Servo/res/Servo.rc2
Binary files differ
SourceCode/Bond/Servo/res/application.exe.manifest
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
    <assemblyIdentity
         name="XP style manifest"
         processorArchitecture="amd64"
         version="1.0.0.0"
         type="win32"/>
    <dependency>
        <dependentAssembly>
            <assemblyIdentity
                type="win32"
                name="Microsoft.Windows.Common-Controls"
                version="6.0.0.0"
                processorArchitecture="amd64"
                publicKeyToken="6595b64144ccf1df"
                language="*"
            />
        </dependentAssembly>
    </dependency>
</assembly>
SourceCode/Bond/Servo/resource.h
Binary files differ
SourceCode/Bond/Servo/stdafx.cpp
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,8 @@
// stdafx.cpp : åªåŒ…括标准包含文件的源文件
// Servo.pch å°†ä½œä¸ºé¢„编译头
// stdafx.obj å°†åŒ…含预编译类型信息
#include "stdafx.h"
SourceCode/Bond/Servo/stdafx.h
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,54 @@
// stdafx.h : æ ‡å‡†ç³»ç»ŸåŒ…含文件的包含文件,
// æˆ–是经常使用但不常更改的
// ç‰¹å®šäºŽé¡¹ç›®çš„包含文件
#pragma once
#ifndef VC_EXTRALEAN
#define VC_EXTRALEAN            // ä»Ž Windows å¤´ä¸­æŽ’除极少使用的资料
#endif
#include "targetver.h"
#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS      // æŸäº› CString æž„造函数将是显式的
// å…³é—­ MFC å¯¹æŸäº›å¸¸è§ä½†ç»å¸¸å¯æ”¾å¿ƒå¿½ç•¥çš„警告消息的隐藏
#define _AFX_ALL_WARNINGS
#include <afxwin.h>         // MFC æ ¸å¿ƒç»„件和标准组件
#include <afxext.h>         // MFC æ‰©å±•
#include <afxdisp.h>        // MFC è‡ªåŠ¨åŒ–ç±»
#ifndef _AFX_NO_OLE_SUPPORT
#include <afxdtctl.h>           // MFC å¯¹ Internet Explorer 4 å…¬å…±æŽ§ä»¶çš„æ”¯æŒ
#endif
#ifndef _AFX_NO_AFXCMN_SUPPORT
#include <afxcmn.h>             // MFC å¯¹ Windows å…¬å…±æŽ§ä»¶çš„æ”¯æŒ
#endif // _AFX_NO_AFXCMN_SUPPORT
#include <afxcontrolbars.h>     // åŠŸèƒ½åŒºå’ŒæŽ§ä»¶æ¡çš„ MFC æ”¯æŒ
#ifdef _UNICODE
#if defined _M_IX86
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='x86' publicKeyToken='6595b64144ccf1df' language='*'\"")
#elif defined _M_X64
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='amd64' publicKeyToken='6595b64144ccf1df' language='*'\"")
#else
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"")
#endif
#endif
SourceCode/Bond/Servo/targetver.h
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,8 @@
#pragma once
// åŒ…括 SDKDDKVer.h å°†å®šä¹‰å¯ç”¨çš„æœ€é«˜ç‰ˆæœ¬çš„ Windows å¹³å°ã€‚
// å¦‚果要为以前的 Windows å¹³å°ç”Ÿæˆåº”用程序,请包括 WinSDKVer.h,并将
// å°† _WIN32_WINNT å®è®¾ç½®ä¸ºè¦æ”¯æŒçš„平台,然后再包括 SDKDDKVer.h。
#include <SDKDDKVer.h>
SourceCode/Bond/x64/Debug/Res/Servo.bmp
SourceCode/Bond/x64/Debug/Res/Servo001.bmp