diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000000000000000000000000000000000000..1ff0c423042b46cb1d617b81efb715defbe8054d --- /dev/null +++ b/.gitattributes @@ -0,0 +1,63 @@ +############################################################################### +# Set default behavior to automatically normalize line endings. +############################################################################### +* text=auto + +############################################################################### +# Set default behavior for command prompt diff. +# +# This is need for earlier builds of msysgit that does not have it on by +# default for csharp files. +# Note: This is only used by command line +############################################################################### +#*.cs diff=csharp + +############################################################################### +# Set the merge driver for project and solution files +# +# Merging from the command prompt will add diff markers to the files if there +# are conflicts (Merging from VS is not affected by the settings below, in VS +# the diff markers are never inserted). Diff markers may cause the following +# file extensions to fail to load in VS. An alternative would be to treat +# these files as binary and thus will always conflict and require user +# intervention with every merge. To do so, just uncomment the entries below +############################################################################### +#*.sln merge=binary +#*.csproj merge=binary +#*.vbproj merge=binary +#*.vcxproj merge=binary +#*.vcproj merge=binary +#*.dbproj merge=binary +#*.fsproj merge=binary +#*.lsproj merge=binary +#*.wixproj merge=binary +#*.modelproj merge=binary +#*.sqlproj merge=binary +#*.wwaproj merge=binary + +############################################################################### +# behavior for image files +# +# image files are treated as binary by default. +############################################################################### +#*.jpg binary +#*.png binary +#*.gif binary + +############################################################################### +# diff behavior for common document formats +# +# Convert binary document formats to text before diffing them. This feature +# is only available from the command line. Turn it on by uncommenting the +# entries below. +############################################################################### +#*.doc diff=astextplain +#*.DOC diff=astextplain +#*.docx diff=astextplain +#*.DOCX diff=astextplain +#*.dot diff=astextplain +#*.DOT diff=astextplain +#*.pdf diff=astextplain +#*.PDF diff=astextplain +#*.rtf diff=astextplain +#*.RTF diff=astextplain diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..3c4efe206bd0e7230ad0ae8396a3c883c8207906 --- /dev/null +++ b/.gitignore @@ -0,0 +1,261 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. + +# User-specific files +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ + +# Visual Studio 2015 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUNIT +*.VisualState.xml +TestResult.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# DNX +project.lock.json +project.fragment.lock.json +artifacts/ + +*_i.c +*_p.c +*_i.h +*.ilk +*.meta +*.obj +*.pch +*.pdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# JustCode is a .NET coding add-in +.JustCode + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# TODO: Comment the next line if you want to checkin your web deploy settings +# but database connection strings (with potential passwords) will be unencrypted +#*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# The packages folder can be ignored because of Package Restore +**/packages/* +# except build/, which is used as an MSBuild target. +!**/packages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/packages/repositories.config +# NuGet v3's project.json files produces more ignoreable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +node_modules/ +orleans.codegen.cs + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm + +# SQL Server files +*.mdf +*.ldf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# JetBrains Rider +.idea/ +*.sln.iml + +# CodeRush +.cr/ + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc \ No newline at end of file diff --git a/arithmetic-operations.sln b/arithmetic-operations.sln new file mode 100644 index 0000000000000000000000000000000000000000..4b9712b9a26d8be39948c8eb535200a9756d73ca --- /dev/null +++ b/arithmetic-operations.sln @@ -0,0 +1,31 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.31313.79 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "arithmetic-operations", "arithmetic-operations\arithmetic-operations.vcxproj", "{F7F3A738-DD5B-4BF4-A8E0-B35CD6F47BBC}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {F7F3A738-DD5B-4BF4-A8E0-B35CD6F47BBC}.Debug|x64.ActiveCfg = Debug|x64 + {F7F3A738-DD5B-4BF4-A8E0-B35CD6F47BBC}.Debug|x64.Build.0 = Debug|x64 + {F7F3A738-DD5B-4BF4-A8E0-B35CD6F47BBC}.Debug|x86.ActiveCfg = Debug|Win32 + {F7F3A738-DD5B-4BF4-A8E0-B35CD6F47BBC}.Debug|x86.Build.0 = Debug|Win32 + {F7F3A738-DD5B-4BF4-A8E0-B35CD6F47BBC}.Release|x64.ActiveCfg = Release|x64 + {F7F3A738-DD5B-4BF4-A8E0-B35CD6F47BBC}.Release|x64.Build.0 = Release|x64 + {F7F3A738-DD5B-4BF4-A8E0-B35CD6F47BBC}.Release|x86.ActiveCfg = Release|Win32 + {F7F3A738-DD5B-4BF4-A8E0-B35CD6F47BBC}.Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {638C8553-2DB5-4865-945F-72684C761FD7} + EndGlobalSection +EndGlobal diff --git a/arithmetic-operations/arithmetic-operations.cpp b/arithmetic-operations/arithmetic-operations.cpp new file mode 100644 index 0000000000000000000000000000000000000000..37d82996cfbb0e829da149429883358f31a7e018 --- /dev/null +++ b/arithmetic-operations/arithmetic-operations.cpp @@ -0,0 +1,26 @@ +// arithmetic-operations.cpp : 定义 DLL 的导出函数。 +// + +#include "pch.h" +#include "framework.h" +#include "arithmetic-operations.h" + + +// 这是导出变量的一个示例 +ARITHMETICOPERATIONS_API int narithmeticoperations=0; + +// 这是导出函数的一个示例。 +ARITHMETICOPERATIONS_API int fnarithmeticoperations(void) +{ + return 0; +} + +// 这是已导出类的构造函数。 +Carithmeticoperations::Carithmeticoperations() +{ + return; +} + +int sum(int a, int b) { + return a + b; +} diff --git a/arithmetic-operations/arithmetic-operations.h b/arithmetic-operations/arithmetic-operations.h new file mode 100644 index 0000000000000000000000000000000000000000..301e7d42636a75975b3ba56f6e24721b55ef02a6 --- /dev/null +++ b/arithmetic-operations/arithmetic-operations.h @@ -0,0 +1,24 @@ +// 下列 ifdef 块是创建使从 DLL 导出更简单的 +// 宏的标准方法。此 DLL 中的所有文件都是用命令行上定义的 ARITHMETICOPERATIONS_EXPORTS +// 符号编译的。在使用此 DLL 的 +// 任何项目上不应定义此符号。这样,源文件中包含此文件的任何其他项目都会将 +// ARITHMETICOPERATIONS_API 函数视为是从 DLL 导入的,而此 DLL 则将用此宏定义的 +// 符号视为是被导出的。 +#ifdef ARITHMETICOPERATIONS_EXPORTS +#define ARITHMETICOPERATIONS_API __declspec(dllexport) +#else +#define ARITHMETICOPERATIONS_API __declspec(dllimport) +#endif + +// 此类是从 dll 导出的 +class ARITHMETICOPERATIONS_API Carithmeticoperations { +public: + Carithmeticoperations(void); + // TODO: 在此处添加方法。 +}; + +extern ARITHMETICOPERATIONS_API int narithmeticoperations; + +ARITHMETICOPERATIONS_API int fnarithmeticoperations(void); + +extern "C" _declspec(dllexport) int sum(int a, int b); diff --git a/arithmetic-operations/arithmetic-operations.vcxproj b/arithmetic-operations/arithmetic-operations.vcxproj new file mode 100644 index 0000000000000000000000000000000000000000..d13be2ca6cc3bc4d0476dfd6479f133e7ce8a082 --- /dev/null +++ b/arithmetic-operations/arithmetic-operations.vcxproj @@ -0,0 +1,178 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 16.0 + Win32Proj + {f7f3a738-dd5b-4bf4-a8e0-b35cd6f47bbc} + arithmeticoperations + 10.0 + + + + DynamicLibrary + true + v142 + Unicode + + + DynamicLibrary + false + v142 + true + Unicode + + + DynamicLibrary + true + v142 + Unicode + + + DynamicLibrary + false + v142 + true + Unicode + + + + + + + + + + + + + + + + + + + + + true + arithmeticoperations + + + false + arithmeticoperations + + + true + arithmeticoperations + + + false + arithmeticoperations + + + + Level3 + true + WIN32;_DEBUG;ARITHMETICOPERATIONS_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + true + Use + pch.h + + + Windows + true + false + + + + + Level3 + true + true + true + WIN32;NDEBUG;ARITHMETICOPERATIONS_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + true + Use + pch.h + + + Windows + true + true + true + false + + + + + Level3 + true + _DEBUG;ARITHMETICOPERATIONS_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + true + Use + pch.h + + + Windows + true + false + + + + + Level3 + true + true + true + NDEBUG;ARITHMETICOPERATIONS_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + true + Use + pch.h + + + Windows + true + true + true + false + + + + + + + + + + + + + + + Create + Create + Create + Create + + + + + + \ No newline at end of file diff --git a/arithmetic-operations/arithmetic-operations.vcxproj.filters b/arithmetic-operations/arithmetic-operations.vcxproj.filters new file mode 100644 index 0000000000000000000000000000000000000000..81f1ada6670188fac28ce9d0823ae08817afe647 --- /dev/null +++ b/arithmetic-operations/arithmetic-operations.vcxproj.filters @@ -0,0 +1,42 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + + + + 头文件 + + + 头文件 + + + 头文件 + + + + + 源文件 + + + 源文件 + + + 源文件 + + + \ No newline at end of file diff --git a/arithmetic-operations/cpp.hint b/arithmetic-operations/cpp.hint new file mode 100644 index 0000000000000000000000000000000000000000..a0516c0deee65432ec0a61d0e305af4171f944e4 --- /dev/null +++ b/arithmetic-operations/cpp.hint @@ -0,0 +1,2 @@ +#define ARITHMETICOPERATIONS_API __declspec(dllexport) +#define ARITHMETICOPERATIONS_API __declspec(dllimport) diff --git a/arithmetic-operations/dllmain.cpp b/arithmetic-operations/dllmain.cpp new file mode 100644 index 0000000000000000000000000000000000000000..daed8c8f7ac50ca1466016a0529648d18125a7e7 --- /dev/null +++ b/arithmetic-operations/dllmain.cpp @@ -0,0 +1,19 @@ +// dllmain.cpp : 定义 DLL 应用程序的入口点。 +#include "pch.h" + +BOOL APIENTRY DllMain( HMODULE hModule, + DWORD ul_reason_for_call, + LPVOID lpReserved + ) +{ + switch (ul_reason_for_call) + { + case DLL_PROCESS_ATTACH: + case DLL_THREAD_ATTACH: + case DLL_THREAD_DETACH: + case DLL_PROCESS_DETACH: + break; + } + return TRUE; +} + diff --git a/arithmetic-operations/framework.h b/arithmetic-operations/framework.h new file mode 100644 index 0000000000000000000000000000000000000000..80cbbc9b06a9b0141f92ee19eceaed71328caff4 --- /dev/null +++ b/arithmetic-operations/framework.h @@ -0,0 +1,5 @@ +#pragma once + +#define WIN32_LEAN_AND_MEAN // 从 Windows 头文件中排除极少使用的内容 +// Windows 头文件 +#include diff --git a/arithmetic-operations/pch.cpp b/arithmetic-operations/pch.cpp new file mode 100644 index 0000000000000000000000000000000000000000..b6fb8f4ab8139ad5173d9cb41220b4ec991ae9e8 --- /dev/null +++ b/arithmetic-operations/pch.cpp @@ -0,0 +1,5 @@ +// pch.cpp: 与预编译标头对应的源文件 + +#include "pch.h" + +// 当使用预编译的头时,需要使用此源文件,编译才能成功。 diff --git a/arithmetic-operations/pch.h b/arithmetic-operations/pch.h new file mode 100644 index 0000000000000000000000000000000000000000..966092717e1dd88467dc6cbe6792c0e89e7397c0 --- /dev/null +++ b/arithmetic-operations/pch.h @@ -0,0 +1,13 @@ +// pch.h: 这是预编译标头文件。 +// 下方列出的文件仅编译一次,提高了将来生成的生成性能。 +// 这还将影响 IntelliSense 性能,包括代码完成和许多代码浏览功能。 +// 但是,如果此处列出的文件中的任何一个在生成之间有更新,它们全部都将被重新编译。 +// 请勿在此处添加要频繁更新的文件,这将使得性能优势无效。 + +#ifndef PCH_H +#define PCH_H + +// 添加要在此处预编译的标头 +#include "framework.h" + +#endif //PCH_H