From a494c9b2f325f13c6b1c87b550eb9d735bcc83c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E6=98=A5=E5=B1=B1?= <1760264627@qq.com> Date: Wed, 2 Dec 2020 10:02:56 +0800 Subject: [PATCH] 12.2 --- .gitignore | 362 ++++++++++++++++++++++++++++++++++ jia/chen/chen.cpp | 22 +++ jia/chen/chen.h | 11 ++ jia/chen/chen.vcxproj | 87 ++++++++ jia/chen/chen.vcxproj.filters | 27 +++ jia/chu/chu.cpp | 14 ++ jia/chu/chu.h | 7 + jia/chu/chu.vcxproj | 91 +++++++++ jia/chu/chu.vcxproj.filters | 30 +++ jia/chu/main.cpp | 52 +++++ jia/jia.sln | 40 ++++ jia/jia/ReadMe.txt | 21 ++ jia/jia/jia.cpp | 23 +++ jia/jia/jia.h | 6 + jia/jia/jia.vcxproj | 85 ++++++++ jia/jia/jia.vcxproj.filters | 30 +++ jia/jian/jian.cpp | 21 ++ jia/jian/jian.h | 11 ++ jia/jian/jian.vcxproj | 87 ++++++++ jia/jian/jian.vcxproj.filters | 27 +++ 20 files changed, 1054 insertions(+) create mode 100644 .gitignore create mode 100644 jia/chen/chen.cpp create mode 100644 jia/chen/chen.h create mode 100644 jia/chen/chen.vcxproj create mode 100644 jia/chen/chen.vcxproj.filters create mode 100644 jia/chu/chu.cpp create mode 100644 jia/chu/chu.h create mode 100644 jia/chu/chu.vcxproj create mode 100644 jia/chu/chu.vcxproj.filters create mode 100644 jia/chu/main.cpp create mode 100644 jia/jia.sln create mode 100644 jia/jia/ReadMe.txt create mode 100644 jia/jia/jia.cpp create mode 100644 jia/jia/jia.h create mode 100644 jia/jia/jia.vcxproj create mode 100644 jia/jia/jia.vcxproj.filters create mode 100644 jia/jian/jian.cpp create mode 100644 jia/jian/jian.h create mode 100644 jia/jian/jian.vcxproj create mode 100644 jia/jian/jian.vcxproj.filters diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1ee5385 --- /dev/null +++ b/.gitignore @@ -0,0 +1,362 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +## +## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore + +# User-specific files +*.rsuser +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Mono auto generated files +mono_crash.* + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +[Ww][Ii][Nn]32/ +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ +[Ll]ogs/ + +# Visual Studio 2015/2017 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# Visual Studio 2017 auto generated files +Generated\ Files/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUnit +*.VisualState.xml +TestResult.xml +nunit-*.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET Core +project.lock.json +project.fragment.lock.json +artifacts/ + +# ASP.NET Scaffolding +ScaffoldingReadMe.txt + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio +*_i.c +*_p.c +*_h.h +*.ilk +*.meta +*.obj +*.iobj +*.pch +*.pdb +*.ipdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*_wpftmp.csproj +*.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 + +# Visual Studio Trace Files +*.e2e + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Coverlet is a free, cross platform Code Coverage Tool +coverage*.json +coverage*.xml +coverage*.info + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# 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 +# Note: 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 +# NuGet Symbol Packages +*.snupkg +# The packages folder can be ignored because of Package Restore +**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/[Pp]ackages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable 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 +*.appx +*.appxbundle +*.appxupload + +# 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 +orleans.codegen.cs + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + +# 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 +ServiceFabricBackup/ +*.rptproj.bak + +# SQL Server files +*.mdf +*.ldf +*.ndf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings +*.rptproj.rsuser +*- [Bb]ackup.rdl +*- [Bb]ackup ([0-9]).rdl +*- [Bb]ackup ([0-9][0-9]).rdl + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat +node_modules/ + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# 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/ + +# CodeRush personal settings +.cr/personal + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +.mfractor/ + +# Local History for Visual Studio +.localhistory/ + +# BeatPulse healthcheck temp database +healthchecksdb + +# Backup folder for Package Reference Convert tool in Visual Studio 2017 +MigrationBackup/ + +# Ionide (cross platform F# VS Code tools) working folder +.ionide/ + +# Fody - auto-generated XML schema +FodyWeavers.xsd diff --git a/jia/chen/chen.cpp b/jia/chen/chen.cpp new file mode 100644 index 0000000..fd50673 --- /dev/null +++ b/jia/chen/chen.cpp @@ -0,0 +1,22 @@ +#include "chen.h" +#include +bool chen(int a, int b, int *e) +{ + if (a>0 && b>0 && a > INT_MAX / b || a<0 && b<0 && a < INT_MAX / b || a>0 && b<0 && a < INT_MIN / b || a<0 && b>0 && a > INT_MIN /b ) + { + + return false; + } + else + { + *e = a * b; + return true; + + } + +} +int mul(int a, int b) +{ + + return a * b; +} diff --git a/jia/chen/chen.h b/jia/chen/chen.h new file mode 100644 index 0000000..00d7cae --- /dev/null +++ b/jia/chen/chen.h @@ -0,0 +1,11 @@ +#ifndef MUL_H +#define MUL_H +#ifdef _DLLAPI +#define DLLAPI _declspec(dllexport) +#else +#define DLLAPI _declspec(dllimport) +#endif +extern "C" int DLLAPI mul(int a, int b); +extern "C" bool DLLAPI chen(int a, int b, int *e); + +#endif \ No newline at end of file diff --git a/jia/chen/chen.vcxproj b/jia/chen/chen.vcxproj new file mode 100644 index 0000000..8284d80 --- /dev/null +++ b/jia/chen/chen.vcxproj @@ -0,0 +1,87 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + {D3E01979-7A19-4FCB-B43B-59E1F322215F} + Win32Proj + chen + + + + DynamicLibrary + true + v120 + Unicode + + + DynamicLibrary + false + v120 + true + Unicode + + + + + + + + + + + + + true + + + false + + + + + + Level3 + Disabled + WIN32;_DEBUG;_WINDOWS;_USRDLL;CHEN_EXPORTS;_DLLAPI;%(PreprocessorDefinitions) + + + Windows + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_WINDOWS;_USRDLL;CHEN_EXPORTS;%(PreprocessorDefinitions) + + + Windows + true + true + true + + + + + + + + + + + + \ No newline at end of file diff --git a/jia/chen/chen.vcxproj.filters b/jia/chen/chen.vcxproj.filters new file mode 100644 index 0000000..2cda313 --- /dev/null +++ b/jia/chen/chen.vcxproj.filters @@ -0,0 +1,27 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;hm;inl;inc;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/jia/chu/chu.cpp b/jia/chu/chu.cpp new file mode 100644 index 0000000..4270af7 --- /dev/null +++ b/jia/chu/chu.cpp @@ -0,0 +1,14 @@ +#include "chu.h" + + +int chu(int a, int b) +{ + if (0 != b) + { + return a / b; + } + else + { + return 0; + } +} diff --git a/jia/chu/chu.h b/jia/chu/chu.h new file mode 100644 index 0000000..c2d7d0e --- /dev/null +++ b/jia/chu/chu.h @@ -0,0 +1,7 @@ +#ifndef DIV_H +#define DIV_H + +int chu(int a, int b); + + +#endif \ No newline at end of file diff --git a/jia/chu/chu.vcxproj b/jia/chu/chu.vcxproj new file mode 100644 index 0000000..b24ca63 --- /dev/null +++ b/jia/chu/chu.vcxproj @@ -0,0 +1,91 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + {1A262FA8-268E-4CDD-8411-9C91E928BB6C} + Win32Proj + chu + + + + Application + true + v120 + Unicode + + + Application + false + v120 + true + Unicode + + + + + + + + + + + + + true + + + false + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;_LIB;_DLLAPI;%(PreprocessorDefinitions) + ..\jia\jia.h;%(AdditionalIncludeDirectories) + + + Console + true + ..\Debug;%(AdditionalLibraryDirectories) + ..\Debug\jia.lib;..\Debug\jian.lib;..\Debug\chen.lib;%(AdditionalDependencies) + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions) + + + Console + true + true + true + + + + + + + + + + + + + \ No newline at end of file diff --git a/jia/chu/chu.vcxproj.filters b/jia/chu/chu.vcxproj.filters new file mode 100644 index 0000000..c0c538b --- /dev/null +++ b/jia/chu/chu.vcxproj.filters @@ -0,0 +1,30 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;hm;inl;inc;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/jia/chu/main.cpp b/jia/chu/main.cpp new file mode 100644 index 0000000..49c569a --- /dev/null +++ b/jia/chu/main.cpp @@ -0,0 +1,52 @@ +#include +#include "../jia/jia.h" +//#pragma comment(lib,"jia.lib") +#include "../jian/jian.h" +//#pragma comment(lib,"jian.lib") +#include "chu.h" +#include "Windows.h" +#include "../chen/chen.h" + +typedef int(*PMUL)(int a, int b); +typedef bool(*QCHEN)(int a, int b,int *e); +int main() +{ + + int a, b; + int c = 0; + int d = 0; + int e = 0; + + printf("\n"); + scanf("%d%d", &a, &b); + + bool ret1 = Add(a, b, &c); + printf("%d %d\n",ret1,c); + printf("add(a,b)=%d\n", add(a, b)); + + bool ret2 = Sub(a, b, &d); + printf("%d %d\n", ret2,d); + printf("sub(a,b)=%d\n", sub(a, b)); + + + HMODULE hDLL = LoadLibrary(L"../Debug/chen.dll"); + if (hDLL == NULL) + { + printf("DLLļʧ\n"); + return 0; + + } + PMUL pMul = (PMUL)GetProcAddress(hDLL, "mul"); + QCHEN qChen = (QCHEN)GetProcAddress(hDLL, "chen"); + + bool ret3 = chen(a, b, &e); + printf("%d %d\n", ret3, e); + + printf("mul(a,b)=%d\n",pMul(a,b)); + printf("chu(a,b)=%d\n", chu(a, b)); + + FreeLibrary(hDLL); + + + +} \ No newline at end of file diff --git a/jia/jia.sln b/jia/jia.sln new file mode 100644 index 0000000..6b08a48 --- /dev/null +++ b/jia/jia.sln @@ -0,0 +1,40 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2013 +VisualStudioVersion = 12.0.40629.0 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "jia", "jia\jia.vcxproj", "{FC133E06-9EE0-4441-A557-12C5BFB381DB}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "chu", "chu\chu.vcxproj", "{1A262FA8-268E-4CDD-8411-9C91E928BB6C}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "chen", "chen\chen.vcxproj", "{D3E01979-7A19-4FCB-B43B-59E1F322215F}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "jian", "jian\jian.vcxproj", "{D63C0C9A-957C-480B-91CA-63EEB17CC4D3}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {FC133E06-9EE0-4441-A557-12C5BFB381DB}.Debug|Win32.ActiveCfg = Debug|Win32 + {FC133E06-9EE0-4441-A557-12C5BFB381DB}.Debug|Win32.Build.0 = Debug|Win32 + {FC133E06-9EE0-4441-A557-12C5BFB381DB}.Release|Win32.ActiveCfg = Release|Win32 + {FC133E06-9EE0-4441-A557-12C5BFB381DB}.Release|Win32.Build.0 = Release|Win32 + {1A262FA8-268E-4CDD-8411-9C91E928BB6C}.Debug|Win32.ActiveCfg = Debug|Win32 + {1A262FA8-268E-4CDD-8411-9C91E928BB6C}.Debug|Win32.Build.0 = Debug|Win32 + {1A262FA8-268E-4CDD-8411-9C91E928BB6C}.Release|Win32.ActiveCfg = Release|Win32 + {1A262FA8-268E-4CDD-8411-9C91E928BB6C}.Release|Win32.Build.0 = Release|Win32 + {D3E01979-7A19-4FCB-B43B-59E1F322215F}.Debug|Win32.ActiveCfg = Debug|Win32 + {D3E01979-7A19-4FCB-B43B-59E1F322215F}.Debug|Win32.Build.0 = Debug|Win32 + {D3E01979-7A19-4FCB-B43B-59E1F322215F}.Release|Win32.ActiveCfg = Release|Win32 + {D3E01979-7A19-4FCB-B43B-59E1F322215F}.Release|Win32.Build.0 = Release|Win32 + {D63C0C9A-957C-480B-91CA-63EEB17CC4D3}.Debug|Win32.ActiveCfg = Debug|Win32 + {D63C0C9A-957C-480B-91CA-63EEB17CC4D3}.Debug|Win32.Build.0 = Debug|Win32 + {D63C0C9A-957C-480B-91CA-63EEB17CC4D3}.Release|Win32.ActiveCfg = Release|Win32 + {D63C0C9A-957C-480B-91CA-63EEB17CC4D3}.Release|Win32.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/jia/jia/ReadMe.txt b/jia/jia/ReadMe.txt new file mode 100644 index 0000000..66615c0 --- /dev/null +++ b/jia/jia/ReadMe.txt @@ -0,0 +1,21 @@ +======================================================================== + 静态库:jia 项目概述 +======================================================================== + +应用程序向导已为您创建了此 jia 库项目。 + +没有为此项目创建源文件。 + + +jia.vcxproj + 这是使用应用程序向导生成的 VC++ 项目的主项目文件,其中包含生成该文件的 Visual C++ 的版本信息,以及有关使用应用程序向导选择的平台、配置和项目功能的信息。 + +jia.vcxproj.filters + 这是使用“应用程序向导”生成的 VC++ 项目筛选器文件。它包含有关项目文件与筛选器之间的关联信息。在 IDE 中,通过这种关联,在特定节点下以分组形式显示具有相似扩展名的文件。例如,“.cpp”文件与“源文件”筛选器关联。 + +///////////////////////////////////////////////////////////////////////////// +其他注释: + +应用程序向导使用“TODO:”注释来指示应添加或自定义的源代码部分。 + +///////////////////////////////////////////////////////////////////////////// diff --git a/jia/jia/jia.cpp b/jia/jia/jia.cpp new file mode 100644 index 0000000..b87e6e4 --- /dev/null +++ b/jia/jia/jia.cpp @@ -0,0 +1,23 @@ +#include "jia.h" +#include +bool Add(int a, int b, int *c) +{ + if (a>0&&b>0&&a > INT_MAX - b ||a<0&&b<0&& a < INT_MIN - b) + { + + return false; + } + else + { + *c = a + b; + return true; + + } + +} +int add(int a, int b) +{ + return a + b; +} + + diff --git a/jia/jia/jia.h b/jia/jia/jia.h new file mode 100644 index 0000000..a4056c5 --- /dev/null +++ b/jia/jia/jia.h @@ -0,0 +1,6 @@ +#ifndef ADD_H +#define ADD_H + +bool Add(int a, int b, int *c); +int add(int a, int b); +#endif \ No newline at end of file diff --git a/jia/jia/jia.vcxproj b/jia/jia/jia.vcxproj new file mode 100644 index 0000000..769082f --- /dev/null +++ b/jia/jia/jia.vcxproj @@ -0,0 +1,85 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + {FC133E06-9EE0-4441-A557-12C5BFB381DB} + Win32Proj + jia + + + + StaticLibrary + true + v120 + Unicode + + + StaticLibrary + false + v120 + true + Unicode + + + + + + + + + + + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions) + + + Windows + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions) + + + Windows + true + true + true + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/jia/jia/jia.vcxproj.filters b/jia/jia/jia.vcxproj.filters new file mode 100644 index 0000000..51fb8f6 --- /dev/null +++ b/jia/jia/jia.vcxproj.filters @@ -0,0 +1,30 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;hm;inl;inc;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/jia/jian/jian.cpp b/jia/jian/jian.cpp new file mode 100644 index 0000000..0910a58 --- /dev/null +++ b/jia/jian/jian.cpp @@ -0,0 +1,21 @@ +#include "jian.h" +#include +bool Sub(int a, int b, int *d) +{ + if (a>0 &&b<0 && a > INT_MAX + b || a<0 && b>0 && a < INT_MIN + b) + { + + return false; + } + else + { + *d = a - b; + return true; + + } + +} +int sub(int a, int b) +{ + return a - b; +} \ No newline at end of file diff --git a/jia/jian/jian.h b/jia/jian/jian.h new file mode 100644 index 0000000..1bb7f66 --- /dev/null +++ b/jia/jian/jian.h @@ -0,0 +1,11 @@ +#ifndef SUB_H +#define SUB_H +#ifdef _DLLAPI +#define DLLAPI _declspec(dllexport) +#else +#define DLLAPI _declspec(dllimport) +#endif +int DLLAPI sub(int a, int b); +bool DLLAPI Sub(int a, int b, int *d); + +#endif \ No newline at end of file diff --git a/jia/jian/jian.vcxproj b/jia/jian/jian.vcxproj new file mode 100644 index 0000000..9b13e32 --- /dev/null +++ b/jia/jian/jian.vcxproj @@ -0,0 +1,87 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + {D63C0C9A-957C-480B-91CA-63EEB17CC4D3} + Win32Proj + jian + + + + DynamicLibrary + true + v120 + Unicode + + + DynamicLibrary + false + v120 + true + Unicode + + + + + + + + + + + + + true + + + false + + + + + + Level3 + Disabled + WIN32;_DEBUG;_WINDOWS;_USRDLL;JIAN_EXPORTS;_DLLAPI;%(PreprocessorDefinitions) + + + Windows + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_WINDOWS;_USRDLL;JIAN_EXPORTS;%(PreprocessorDefinitions) + + + Windows + true + true + true + + + + + + + + + + + + \ No newline at end of file diff --git a/jia/jian/jian.vcxproj.filters b/jia/jian/jian.vcxproj.filters new file mode 100644 index 0000000..1bca5d4 --- /dev/null +++ b/jia/jian/jian.vcxproj.filters @@ -0,0 +1,27 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;hm;inl;inc;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