@@ -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 |
@@ -0,0 +1,22 @@ | |||
#include "chen.h" | |||
#include <limits> | |||
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; | |||
} |
@@ -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 |
@@ -0,0 +1,87 @@ | |||
<?xml version="1.0" encoding="utf-8"?> | |||
<Project DefaultTargets="Build" ToolsVersion="12.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> | |||
</ItemGroup> | |||
<PropertyGroup Label="Globals"> | |||
<ProjectGuid>{D3E01979-7A19-4FCB-B43B-59E1F322215F}</ProjectGuid> | |||
<Keyword>Win32Proj</Keyword> | |||
<RootNamespace>chen</RootNamespace> | |||
</PropertyGroup> | |||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> | |||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> | |||
<ConfigurationType>DynamicLibrary</ConfigurationType> | |||
<UseDebugLibraries>true</UseDebugLibraries> | |||
<PlatformToolset>v120</PlatformToolset> | |||
<CharacterSet>Unicode</CharacterSet> | |||
</PropertyGroup> | |||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> | |||
<ConfigurationType>DynamicLibrary</ConfigurationType> | |||
<UseDebugLibraries>false</UseDebugLibraries> | |||
<PlatformToolset>v120</PlatformToolset> | |||
<WholeProgramOptimization>true</WholeProgramOptimization> | |||
<CharacterSet>Unicode</CharacterSet> | |||
</PropertyGroup> | |||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> | |||
<ImportGroup Label="ExtensionSettings"> | |||
</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> | |||
<PropertyGroup Label="UserMacros" /> | |||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> | |||
<LinkIncremental>true</LinkIncremental> | |||
</PropertyGroup> | |||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> | |||
<LinkIncremental>false</LinkIncremental> | |||
</PropertyGroup> | |||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> | |||
<ClCompile> | |||
<PrecompiledHeader> | |||
</PrecompiledHeader> | |||
<WarningLevel>Level3</WarningLevel> | |||
<Optimization>Disabled</Optimization> | |||
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;CHEN_EXPORTS;_DLLAPI;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |||
</ClCompile> | |||
<Link> | |||
<SubSystem>Windows</SubSystem> | |||
<GenerateDebugInformation>true</GenerateDebugInformation> | |||
</Link> | |||
</ItemDefinitionGroup> | |||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> | |||
<ClCompile> | |||
<WarningLevel>Level3</WarningLevel> | |||
<PrecompiledHeader> | |||
</PrecompiledHeader> | |||
<Optimization>MaxSpeed</Optimization> | |||
<FunctionLevelLinking>true</FunctionLevelLinking> | |||
<IntrinsicFunctions>true</IntrinsicFunctions> | |||
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;CHEN_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |||
</ClCompile> | |||
<Link> | |||
<SubSystem>Windows</SubSystem> | |||
<GenerateDebugInformation>true</GenerateDebugInformation> | |||
<EnableCOMDATFolding>true</EnableCOMDATFolding> | |||
<OptimizeReferences>true</OptimizeReferences> | |||
</Link> | |||
</ItemDefinitionGroup> | |||
<ItemGroup> | |||
<ClInclude Include="chen.h" /> | |||
</ItemGroup> | |||
<ItemGroup> | |||
<ClCompile Include="chen.cpp" /> | |||
</ItemGroup> | |||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> | |||
<ImportGroup Label="ExtensionTargets"> | |||
</ImportGroup> | |||
</Project> |
@@ -0,0 +1,27 @@ | |||
<?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> | |||
<ClInclude Include="chen.h"> | |||
<Filter>头文件</Filter> | |||
</ClInclude> | |||
</ItemGroup> | |||
<ItemGroup> | |||
<ClCompile Include="chen.cpp"> | |||
<Filter>源文件</Filter> | |||
</ClCompile> | |||
</ItemGroup> | |||
</Project> |
@@ -0,0 +1,14 @@ | |||
#include "chu.h" | |||
int chu(int a, int b) | |||
{ | |||
if (0 != b) | |||
{ | |||
return a / b; | |||
} | |||
else | |||
{ | |||
return 0; | |||
} | |||
} |
@@ -0,0 +1,7 @@ | |||
#ifndef DIV_H | |||
#define DIV_H | |||
int chu(int a, int b); | |||
#endif |
@@ -0,0 +1,91 @@ | |||
<?xml version="1.0" encoding="utf-8"?> | |||
<Project DefaultTargets="Build" ToolsVersion="12.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> | |||
</ItemGroup> | |||
<PropertyGroup Label="Globals"> | |||
<ProjectGuid>{1A262FA8-268E-4CDD-8411-9C91E928BB6C}</ProjectGuid> | |||
<Keyword>Win32Proj</Keyword> | |||
<RootNamespace>chu</RootNamespace> | |||
</PropertyGroup> | |||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> | |||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> | |||
<ConfigurationType>Application</ConfigurationType> | |||
<UseDebugLibraries>true</UseDebugLibraries> | |||
<PlatformToolset>v120</PlatformToolset> | |||
<CharacterSet>Unicode</CharacterSet> | |||
</PropertyGroup> | |||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> | |||
<ConfigurationType>Application</ConfigurationType> | |||
<UseDebugLibraries>false</UseDebugLibraries> | |||
<PlatformToolset>v120</PlatformToolset> | |||
<WholeProgramOptimization>true</WholeProgramOptimization> | |||
<CharacterSet>Unicode</CharacterSet> | |||
</PropertyGroup> | |||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> | |||
<ImportGroup Label="ExtensionSettings"> | |||
</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> | |||
<PropertyGroup Label="UserMacros" /> | |||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> | |||
<LinkIncremental>true</LinkIncremental> | |||
</PropertyGroup> | |||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> | |||
<LinkIncremental>false</LinkIncremental> | |||
</PropertyGroup> | |||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> | |||
<ClCompile> | |||
<PrecompiledHeader> | |||
</PrecompiledHeader> | |||
<WarningLevel>Level3</WarningLevel> | |||
<Optimization>Disabled</Optimization> | |||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;_LIB;_DLLAPI;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |||
<AdditionalIncludeDirectories>..\jia\jia.h;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> | |||
</ClCompile> | |||
<Link> | |||
<SubSystem>Console</SubSystem> | |||
<GenerateDebugInformation>true</GenerateDebugInformation> | |||
<AdditionalLibraryDirectories>..\Debug;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> | |||
<AdditionalDependencies>..\Debug\jia.lib;..\Debug\jian.lib;..\Debug\chen.lib;%(AdditionalDependencies)</AdditionalDependencies> | |||
</Link> | |||
</ItemDefinitionGroup> | |||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> | |||
<ClCompile> | |||
<WarningLevel>Level3</WarningLevel> | |||
<PrecompiledHeader> | |||
</PrecompiledHeader> | |||
<Optimization>MaxSpeed</Optimization> | |||
<FunctionLevelLinking>true</FunctionLevelLinking> | |||
<IntrinsicFunctions>true</IntrinsicFunctions> | |||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |||
</ClCompile> | |||
<Link> | |||
<SubSystem>Console</SubSystem> | |||
<GenerateDebugInformation>true</GenerateDebugInformation> | |||
<EnableCOMDATFolding>true</EnableCOMDATFolding> | |||
<OptimizeReferences>true</OptimizeReferences> | |||
</Link> | |||
</ItemDefinitionGroup> | |||
<ItemGroup> | |||
<ClCompile Include="chu.cpp" /> | |||
<ClCompile Include="main.cpp" /> | |||
</ItemGroup> | |||
<ItemGroup> | |||
<ClInclude Include="chu.h" /> | |||
</ItemGroup> | |||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> | |||
<ImportGroup Label="ExtensionTargets"> | |||
</ImportGroup> | |||
</Project> |
@@ -0,0 +1,30 @@ | |||
<?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> | |||
<ClCompile Include="main.cpp"> | |||
<Filter>源文件</Filter> | |||
</ClCompile> | |||
<ClCompile Include="chu.cpp"> | |||
<Filter>源文件</Filter> | |||
</ClCompile> | |||
</ItemGroup> | |||
<ItemGroup> | |||
<ClInclude Include="chu.h"> | |||
<Filter>头文件</Filter> | |||
</ClInclude> | |||
</ItemGroup> | |||
</Project> |
@@ -0,0 +1,52 @@ | |||
#include <stdio.h> | |||
#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); | |||
} |
@@ -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 |
@@ -0,0 +1,21 @@ | |||
======================================================================== | |||
静态库:jia 项目概述 | |||
======================================================================== | |||
应用程序向导已为您创建了此 jia 库项目。 | |||
没有为此项目创建源文件。 | |||
jia.vcxproj | |||
这是使用应用程序向导生成的 VC++ 项目的主项目文件,其中包含生成该文件的 Visual C++ 的版本信息,以及有关使用应用程序向导选择的平台、配置和项目功能的信息。 | |||
jia.vcxproj.filters | |||
这是使用“应用程序向导”生成的 VC++ 项目筛选器文件。它包含有关项目文件与筛选器之间的关联信息。在 IDE 中,通过这种关联,在特定节点下以分组形式显示具有相似扩展名的文件。例如,“.cpp”文件与“源文件”筛选器关联。 | |||
///////////////////////////////////////////////////////////////////////////// | |||
其他注释: | |||
应用程序向导使用“TODO:”注释来指示应添加或自定义的源代码部分。 | |||
///////////////////////////////////////////////////////////////////////////// |
@@ -0,0 +1,23 @@ | |||
#include "jia.h" | |||
#include <limits> | |||
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; | |||
} | |||
@@ -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 |
@@ -0,0 +1,85 @@ | |||
<?xml version="1.0" encoding="utf-8"?> | |||
<Project DefaultTargets="Build" ToolsVersion="12.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> | |||
</ItemGroup> | |||
<PropertyGroup Label="Globals"> | |||
<ProjectGuid>{FC133E06-9EE0-4441-A557-12C5BFB381DB}</ProjectGuid> | |||
<Keyword>Win32Proj</Keyword> | |||
<RootNamespace>jia</RootNamespace> | |||
</PropertyGroup> | |||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> | |||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> | |||
<ConfigurationType>StaticLibrary</ConfigurationType> | |||
<UseDebugLibraries>true</UseDebugLibraries> | |||
<PlatformToolset>v120</PlatformToolset> | |||
<CharacterSet>Unicode</CharacterSet> | |||
</PropertyGroup> | |||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> | |||
<ConfigurationType>StaticLibrary</ConfigurationType> | |||
<UseDebugLibraries>false</UseDebugLibraries> | |||
<PlatformToolset>v120</PlatformToolset> | |||
<WholeProgramOptimization>true</WholeProgramOptimization> | |||
<CharacterSet>Unicode</CharacterSet> | |||
</PropertyGroup> | |||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> | |||
<ImportGroup Label="ExtensionSettings"> | |||
</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> | |||
<PropertyGroup Label="UserMacros" /> | |||
<PropertyGroup /> | |||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> | |||
<ClCompile> | |||
<PrecompiledHeader> | |||
</PrecompiledHeader> | |||
<WarningLevel>Level3</WarningLevel> | |||
<Optimization>Disabled</Optimization> | |||
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |||
</ClCompile> | |||
<Link> | |||
<SubSystem>Windows</SubSystem> | |||
<GenerateDebugInformation>true</GenerateDebugInformation> | |||
</Link> | |||
</ItemDefinitionGroup> | |||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> | |||
<ClCompile> | |||
<WarningLevel>Level3</WarningLevel> | |||
<PrecompiledHeader> | |||
</PrecompiledHeader> | |||
<Optimization>MaxSpeed</Optimization> | |||
<FunctionLevelLinking>true</FunctionLevelLinking> | |||
<IntrinsicFunctions>true</IntrinsicFunctions> | |||
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |||
</ClCompile> | |||
<Link> | |||
<SubSystem>Windows</SubSystem> | |||
<GenerateDebugInformation>true</GenerateDebugInformation> | |||
<EnableCOMDATFolding>true</EnableCOMDATFolding> | |||
<OptimizeReferences>true</OptimizeReferences> | |||
</Link> | |||
</ItemDefinitionGroup> | |||
<ItemGroup> | |||
<Text Include="ReadMe.txt" /> | |||
</ItemGroup> | |||
<ItemGroup> | |||
<ClInclude Include="jia.h" /> | |||
</ItemGroup> | |||
<ItemGroup> | |||
<ClCompile Include="jia.cpp" /> | |||
</ItemGroup> | |||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> | |||
<ImportGroup Label="ExtensionTargets"> | |||
</ImportGroup> | |||
</Project> |
@@ -0,0 +1,30 @@ | |||
<?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="jia.h"> | |||
<Filter>头文件</Filter> | |||
</ClInclude> | |||
</ItemGroup> | |||
<ItemGroup> | |||
<ClCompile Include="jia.cpp"> | |||
<Filter>源文件</Filter> | |||
</ClCompile> | |||
</ItemGroup> | |||
</Project> |
@@ -0,0 +1,21 @@ | |||
#include "jian.h" | |||
#include <limits> | |||
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; | |||
} |
@@ -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 |
@@ -0,0 +1,87 @@ | |||
<?xml version="1.0" encoding="utf-8"?> | |||
<Project DefaultTargets="Build" ToolsVersion="12.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> | |||
</ItemGroup> | |||
<PropertyGroup Label="Globals"> | |||
<ProjectGuid>{D63C0C9A-957C-480B-91CA-63EEB17CC4D3}</ProjectGuid> | |||
<Keyword>Win32Proj</Keyword> | |||
<RootNamespace>jian</RootNamespace> | |||
</PropertyGroup> | |||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> | |||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> | |||
<ConfigurationType>DynamicLibrary</ConfigurationType> | |||
<UseDebugLibraries>true</UseDebugLibraries> | |||
<PlatformToolset>v120</PlatformToolset> | |||
<CharacterSet>Unicode</CharacterSet> | |||
</PropertyGroup> | |||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> | |||
<ConfigurationType>DynamicLibrary</ConfigurationType> | |||
<UseDebugLibraries>false</UseDebugLibraries> | |||
<PlatformToolset>v120</PlatformToolset> | |||
<WholeProgramOptimization>true</WholeProgramOptimization> | |||
<CharacterSet>Unicode</CharacterSet> | |||
</PropertyGroup> | |||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> | |||
<ImportGroup Label="ExtensionSettings"> | |||
</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> | |||
<PropertyGroup Label="UserMacros" /> | |||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> | |||
<LinkIncremental>true</LinkIncremental> | |||
</PropertyGroup> | |||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> | |||
<LinkIncremental>false</LinkIncremental> | |||
</PropertyGroup> | |||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> | |||
<ClCompile> | |||
<PrecompiledHeader> | |||
</PrecompiledHeader> | |||
<WarningLevel>Level3</WarningLevel> | |||
<Optimization>Disabled</Optimization> | |||
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;JIAN_EXPORTS;_DLLAPI;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |||
</ClCompile> | |||
<Link> | |||
<SubSystem>Windows</SubSystem> | |||
<GenerateDebugInformation>true</GenerateDebugInformation> | |||
</Link> | |||
</ItemDefinitionGroup> | |||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> | |||
<ClCompile> | |||
<WarningLevel>Level3</WarningLevel> | |||
<PrecompiledHeader> | |||
</PrecompiledHeader> | |||
<Optimization>MaxSpeed</Optimization> | |||
<FunctionLevelLinking>true</FunctionLevelLinking> | |||
<IntrinsicFunctions>true</IntrinsicFunctions> | |||
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;JIAN_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |||
</ClCompile> | |||
<Link> | |||
<SubSystem>Windows</SubSystem> | |||
<GenerateDebugInformation>true</GenerateDebugInformation> | |||
<EnableCOMDATFolding>true</EnableCOMDATFolding> | |||
<OptimizeReferences>true</OptimizeReferences> | |||
</Link> | |||
</ItemDefinitionGroup> | |||
<ItemGroup> | |||
<ClInclude Include="jian.h" /> | |||
</ItemGroup> | |||
<ItemGroup> | |||
<ClCompile Include="jian.cpp" /> | |||
</ItemGroup> | |||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> | |||
<ImportGroup Label="ExtensionTargets"> | |||
</ImportGroup> | |||
</Project> |
@@ -0,0 +1,27 @@ | |||
<?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> | |||
<ClInclude Include="jian.h"> | |||
<Filter>头文件</Filter> | |||
</ClInclude> | |||
</ItemGroup> | |||
<ItemGroup> | |||
<ClCompile Include="jian.cpp"> | |||
<Filter>源文件</Filter> | |||
</ClCompile> | |||
</ItemGroup> | |||
</Project> |