diff --git a/DllDemo1/Debug/DllDemo1.dll b/DllDemo1/Debug/DllDemo1.dll new file mode 100644 index 0000000..cdf15af Binary files /dev/null and b/DllDemo1/Debug/DllDemo1.dll differ diff --git a/DllDemo1/Debug/DllDemo1.exp b/DllDemo1/Debug/DllDemo1.exp new file mode 100644 index 0000000..7c47979 Binary files /dev/null and b/DllDemo1/Debug/DllDemo1.exp differ diff --git a/DllDemo1/Debug/DllDemo1.lib b/DllDemo1/Debug/DllDemo1.lib new file mode 100644 index 0000000..4ec1781 Binary files /dev/null and b/DllDemo1/Debug/DllDemo1.lib differ diff --git a/DllDemo1/Debug/DllDemo1.pdb b/DllDemo1/Debug/DllDemo1.pdb new file mode 100644 index 0000000..5f4aed7 Binary files /dev/null and b/DllDemo1/Debug/DllDemo1.pdb differ diff --git a/DllDemo1/Debug/IsInvoketest.exe b/DllDemo1/Debug/IsInvoketest.exe new file mode 100644 index 0000000..8aab4ba Binary files /dev/null and b/DllDemo1/Debug/IsInvoketest.exe differ diff --git a/DllDemo1/Debug/IsInvoketest.pdb b/DllDemo1/Debug/IsInvoketest.pdb new file mode 100644 index 0000000..38c8d29 Binary files /dev/null and b/DllDemo1/Debug/IsInvoketest.pdb differ diff --git a/DllDemo1/Debug/XsInvoketest.exe b/DllDemo1/Debug/XsInvoketest.exe new file mode 100644 index 0000000..e303adb Binary files /dev/null and b/DllDemo1/Debug/XsInvoketest.exe differ diff --git a/DllDemo1/Debug/XsInvoketest.pdb b/DllDemo1/Debug/XsInvoketest.pdb new file mode 100644 index 0000000..0d797f5 Binary files /dev/null and b/DllDemo1/Debug/XsInvoketest.pdb differ diff --git a/DllDemo1/DllDemo1.sln b/DllDemo1/DllDemo1.sln new file mode 100644 index 0000000..b8f1e96 --- /dev/null +++ b/DllDemo1/DllDemo1.sln @@ -0,0 +1,51 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.32602.291 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DllDemo1", "DllDemo1\DllDemo1.vcxproj", "{511CD9B5-7ED4-4852-A023-71432477DA33}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "IsInvoketest", "IsInvoketest\IsInvoketest.vcxproj", "{BCF609AC-C6CA-43B2-B070-7CC246A28CDD}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "XsInvoketest", "XsInvoketest\XsInvoketest.vcxproj", "{0BB5461B-CEE1-4D04-992D-90D37397E972}" +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 + {511CD9B5-7ED4-4852-A023-71432477DA33}.Debug|x64.ActiveCfg = Debug|x64 + {511CD9B5-7ED4-4852-A023-71432477DA33}.Debug|x64.Build.0 = Debug|x64 + {511CD9B5-7ED4-4852-A023-71432477DA33}.Debug|x86.ActiveCfg = Debug|Win32 + {511CD9B5-7ED4-4852-A023-71432477DA33}.Debug|x86.Build.0 = Debug|Win32 + {511CD9B5-7ED4-4852-A023-71432477DA33}.Release|x64.ActiveCfg = Release|x64 + {511CD9B5-7ED4-4852-A023-71432477DA33}.Release|x64.Build.0 = Release|x64 + {511CD9B5-7ED4-4852-A023-71432477DA33}.Release|x86.ActiveCfg = Release|Win32 + {511CD9B5-7ED4-4852-A023-71432477DA33}.Release|x86.Build.0 = Release|Win32 + {BCF609AC-C6CA-43B2-B070-7CC246A28CDD}.Debug|x64.ActiveCfg = Debug|x64 + {BCF609AC-C6CA-43B2-B070-7CC246A28CDD}.Debug|x64.Build.0 = Debug|x64 + {BCF609AC-C6CA-43B2-B070-7CC246A28CDD}.Debug|x86.ActiveCfg = Debug|Win32 + {BCF609AC-C6CA-43B2-B070-7CC246A28CDD}.Debug|x86.Build.0 = Debug|Win32 + {BCF609AC-C6CA-43B2-B070-7CC246A28CDD}.Release|x64.ActiveCfg = Release|x64 + {BCF609AC-C6CA-43B2-B070-7CC246A28CDD}.Release|x64.Build.0 = Release|x64 + {BCF609AC-C6CA-43B2-B070-7CC246A28CDD}.Release|x86.ActiveCfg = Release|Win32 + {BCF609AC-C6CA-43B2-B070-7CC246A28CDD}.Release|x86.Build.0 = Release|Win32 + {0BB5461B-CEE1-4D04-992D-90D37397E972}.Debug|x64.ActiveCfg = Debug|x64 + {0BB5461B-CEE1-4D04-992D-90D37397E972}.Debug|x64.Build.0 = Debug|x64 + {0BB5461B-CEE1-4D04-992D-90D37397E972}.Debug|x86.ActiveCfg = Debug|Win32 + {0BB5461B-CEE1-4D04-992D-90D37397E972}.Debug|x86.Build.0 = Debug|Win32 + {0BB5461B-CEE1-4D04-992D-90D37397E972}.Release|x64.ActiveCfg = Release|x64 + {0BB5461B-CEE1-4D04-992D-90D37397E972}.Release|x64.Build.0 = Release|x64 + {0BB5461B-CEE1-4D04-992D-90D37397E972}.Release|x86.ActiveCfg = Release|Win32 + {0BB5461B-CEE1-4D04-992D-90D37397E972}.Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {0494F4F1-83C9-45DC-A454-5ED9F62AAE6E} + EndGlobalSection +EndGlobal diff --git a/DllDemo1/DllDemo1/Debug/DllDemo1.Build.CppClean.log b/DllDemo1/DllDemo1/Debug/DllDemo1.Build.CppClean.log new file mode 100644 index 0000000..0db604d --- /dev/null +++ b/DllDemo1/DllDemo1/Debug/DllDemo1.Build.CppClean.log @@ -0,0 +1,8 @@ +d:\study\dlldemo1\dlldemo1\debug\dlldemo1.pch +d:\study\dlldemo1\dlldemo1\debug\vc142.pdb +d:\study\dlldemo1\dlldemo1\debug\vc142.idb +d:\study\dlldemo1\dlldemo1\debug\pch.obj +d:\study\dlldemo1\dlldemo1\debug\dllmain.obj +d:\study\dlldemo1\dlldemo1\debug\dlldemo1.tlog\cl.command.1.tlog +d:\study\dlldemo1\dlldemo1\debug\dlldemo1.tlog\cl.read.1.tlog +d:\study\dlldemo1\dlldemo1\debug\dlldemo1.tlog\cl.write.1.tlog diff --git a/DllDemo1/DllDemo1/Debug/DllDemo1.dll.recipe b/DllDemo1/DllDemo1/Debug/DllDemo1.dll.recipe new file mode 100644 index 0000000..3af9430 --- /dev/null +++ b/DllDemo1/DllDemo1/Debug/DllDemo1.dll.recipe @@ -0,0 +1,11 @@ + + + + + D:\study\DllDemo1\Debug\DllDemo1.dll + + + + + + \ No newline at end of file diff --git a/DllDemo1/DllDemo1/Debug/DllDemo1.ilk b/DllDemo1/DllDemo1/Debug/DllDemo1.ilk new file mode 100644 index 0000000..17e30e6 Binary files /dev/null and b/DllDemo1/DllDemo1/Debug/DllDemo1.ilk differ diff --git a/DllDemo1/DllDemo1/Debug/DllDemo1.log b/DllDemo1/DllDemo1/Debug/DllDemo1.log new file mode 100644 index 0000000..1a776bd --- /dev/null +++ b/DllDemo1/DllDemo1/Debug/DllDemo1.log @@ -0,0 +1,8 @@ + pch.cpp + dll.cpp +D:\study\DllDemo1\DllDemo1\dll.cpp(7,1): warning C4273: “convert_array”: dll 链接不一致 +D:\study\DllDemo1\DllDemo1\dll.h(8,27): message : 参见“convert_array”的前一个定义 + dllmain.cpp + 正在生成代码... + 正在创建库 D:\study\DllDemo1\Debug\DllDemo1.lib 和对象 D:\study\DllDemo1\Debug\DllDemo1.exp + DllDemo1.vcxproj -> D:\study\DllDemo1\Debug\DllDemo1.dll diff --git a/DllDemo1/DllDemo1/Debug/DllDemo1.pch b/DllDemo1/DllDemo1/Debug/DllDemo1.pch new file mode 100644 index 0000000..83f6cfb Binary files /dev/null and b/DllDemo1/DllDemo1/Debug/DllDemo1.pch differ diff --git a/DllDemo1/DllDemo1/Debug/DllDemo1.tlog/CL.command.1.tlog b/DllDemo1/DllDemo1/Debug/DllDemo1.tlog/CL.command.1.tlog new file mode 100644 index 0000000..22df546 Binary files /dev/null and b/DllDemo1/DllDemo1/Debug/DllDemo1.tlog/CL.command.1.tlog differ diff --git a/DllDemo1/DllDemo1/Debug/DllDemo1.tlog/CL.read.1.tlog b/DllDemo1/DllDemo1/Debug/DllDemo1.tlog/CL.read.1.tlog new file mode 100644 index 0000000..8e6836d Binary files /dev/null and b/DllDemo1/DllDemo1/Debug/DllDemo1.tlog/CL.read.1.tlog differ diff --git a/DllDemo1/DllDemo1/Debug/DllDemo1.tlog/CL.write.1.tlog b/DllDemo1/DllDemo1/Debug/DllDemo1.tlog/CL.write.1.tlog new file mode 100644 index 0000000..72a3b0b Binary files /dev/null and b/DllDemo1/DllDemo1/Debug/DllDemo1.tlog/CL.write.1.tlog differ diff --git a/DllDemo1/DllDemo1/Debug/DllDemo1.tlog/DllDemo1.lastbuildstate b/DllDemo1/DllDemo1/Debug/DllDemo1.tlog/DllDemo1.lastbuildstate new file mode 100644 index 0000000..1736a6b --- /dev/null +++ b/DllDemo1/DllDemo1/Debug/DllDemo1.tlog/DllDemo1.lastbuildstate @@ -0,0 +1,2 @@ +PlatformToolSet=v142:VCToolArchitecture=Native32Bit:VCToolsVersion=14.29.30133:TargetPlatformVersion=10.0.19041.0: +Debug|Win32|D:\study\DllDemo1\| diff --git a/DllDemo1/DllDemo1/Debug/DllDemo1.tlog/DllDemo1.write.1u.tlog b/DllDemo1/DllDemo1/Debug/DllDemo1.tlog/DllDemo1.write.1u.tlog new file mode 100644 index 0000000..c19eddf Binary files /dev/null and b/DllDemo1/DllDemo1/Debug/DllDemo1.tlog/DllDemo1.write.1u.tlog differ diff --git a/DllDemo1/DllDemo1/Debug/DllDemo1.tlog/link.command.1.tlog b/DllDemo1/DllDemo1/Debug/DllDemo1.tlog/link.command.1.tlog new file mode 100644 index 0000000..1062eaa Binary files /dev/null and b/DllDemo1/DllDemo1/Debug/DllDemo1.tlog/link.command.1.tlog differ diff --git a/DllDemo1/DllDemo1/Debug/DllDemo1.tlog/link.read.1.tlog b/DllDemo1/DllDemo1/Debug/DllDemo1.tlog/link.read.1.tlog new file mode 100644 index 0000000..940dff8 Binary files /dev/null and b/DllDemo1/DllDemo1/Debug/DllDemo1.tlog/link.read.1.tlog differ diff --git a/DllDemo1/DllDemo1/Debug/DllDemo1.tlog/link.write.1.tlog b/DllDemo1/DllDemo1/Debug/DllDemo1.tlog/link.write.1.tlog new file mode 100644 index 0000000..bbdc5bc Binary files /dev/null and b/DllDemo1/DllDemo1/Debug/DllDemo1.tlog/link.write.1.tlog differ diff --git a/DllDemo1/DllDemo1/Debug/DllDemo1.vcxproj.FileListAbsolute.txt b/DllDemo1/DllDemo1/Debug/DllDemo1.vcxproj.FileListAbsolute.txt new file mode 100644 index 0000000..e69de29 diff --git a/DllDemo1/DllDemo1/Debug/dll.obj b/DllDemo1/DllDemo1/Debug/dll.obj new file mode 100644 index 0000000..ba5b923 Binary files /dev/null and b/DllDemo1/DllDemo1/Debug/dll.obj differ diff --git a/DllDemo1/DllDemo1/Debug/dllmain.obj b/DllDemo1/DllDemo1/Debug/dllmain.obj new file mode 100644 index 0000000..3d145a8 Binary files /dev/null and b/DllDemo1/DllDemo1/Debug/dllmain.obj differ diff --git a/DllDemo1/DllDemo1/Debug/pch.obj b/DllDemo1/DllDemo1/Debug/pch.obj new file mode 100644 index 0000000..8070ffe Binary files /dev/null and b/DllDemo1/DllDemo1/Debug/pch.obj differ diff --git a/DllDemo1/DllDemo1/Debug/vc142.idb b/DllDemo1/DllDemo1/Debug/vc142.idb new file mode 100644 index 0000000..5e5a627 Binary files /dev/null and b/DllDemo1/DllDemo1/Debug/vc142.idb differ diff --git a/DllDemo1/DllDemo1/Debug/vc142.pdb b/DllDemo1/DllDemo1/Debug/vc142.pdb new file mode 100644 index 0000000..7a7c221 Binary files /dev/null and b/DllDemo1/DllDemo1/Debug/vc142.pdb differ diff --git a/DllDemo1/DllDemo1/DllDemo1.vcxproj b/DllDemo1/DllDemo1/DllDemo1.vcxproj new file mode 100644 index 0000000..c7afaad --- /dev/null +++ b/DllDemo1/DllDemo1/DllDemo1.vcxproj @@ -0,0 +1,171 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 16.0 + Win32Proj + {511cd9b5-7ed4-4852-a023-71432477da33} + DllDemo1 + 10.0 + + + + DynamicLibrary + true + v142 + Unicode + + + DynamicLibrary + false + v142 + true + Unicode + + + DynamicLibrary + true + v142 + Unicode + + + DynamicLibrary + false + v142 + true + Unicode + + + + + + + + + + + + + + + + + + + + + true + + + false + + + true + + + false + + + + Level3 + true + WIN32;_DEBUG;DLLDEMO1_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + true + Use + pch.h + + + Windows + true + false + + + + + Level3 + true + true + true + WIN32;NDEBUG;DLLDEMO1_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + true + Use + pch.h + + + Windows + true + true + true + false + + + + + Level3 + true + _DEBUG;DLLDEMO1_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + true + Use + pch.h + + + Windows + true + false + + + + + Level3 + true + true + true + NDEBUG;DLLDEMO1_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/DllDemo1/DllDemo1/DllDemo1.vcxproj.filters b/DllDemo1/DllDemo1/DllDemo1.vcxproj.filters new file mode 100644 index 0000000..ffe3065 --- /dev/null +++ b/DllDemo1/DllDemo1/DllDemo1.vcxproj.filters @@ -0,0 +1,39 @@ + + + + + {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/DllDemo1/DllDemo1/DllDemo1.vcxproj.user b/DllDemo1/DllDemo1/DllDemo1.vcxproj.user new file mode 100644 index 0000000..0f14913 --- /dev/null +++ b/DllDemo1/DllDemo1/DllDemo1.vcxproj.user @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/DllDemo1/DllDemo1/dll.cpp b/DllDemo1/DllDemo1/dll.cpp new file mode 100644 index 0000000..b8fd399 --- /dev/null +++ b/DllDemo1/DllDemo1/dll.cpp @@ -0,0 +1,21 @@ +#include "pch.h" +#include "dll.h" +#include +using namespace std; + +int convert_array(int* data, int len) +{ + for (int i = 0; i < len; i++) + { + cout << data[i] << ","; + } + cout << endl; + + int nTotal = 0; + for (int i = 0; i < len; i++) + { + nTotal += data[i]; + --data[i]; + } + return nTotal; +} diff --git a/DllDemo1/DllDemo1/dll.h b/DllDemo1/DllDemo1/dll.h new file mode 100644 index 0000000..75ac0d6 --- /dev/null +++ b/DllDemo1/DllDemo1/dll.h @@ -0,0 +1,8 @@ +#pragma once +#ifdef BUILD_DLL +#define API_SYMBOL _declspec(dllexport) +#else +#define API_SYMBOL _declspec(dllimport) +#endif // BUILD_MYDLL + +extern "C" API_SYMBOL int convert_array(int* data, int len); diff --git a/DllDemo1/DllDemo1/dllmain.cpp b/DllDemo1/DllDemo1/dllmain.cpp new file mode 100644 index 0000000..d37928e --- /dev/null +++ b/DllDemo1/DllDemo1/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/DllDemo1/DllDemo1/framework.h b/DllDemo1/DllDemo1/framework.h new file mode 100644 index 0000000..3f0fc4a --- /dev/null +++ b/DllDemo1/DllDemo1/framework.h @@ -0,0 +1,5 @@ +#pragma once + +#define WIN32_LEAN_AND_MEAN // 从 Windows 头文件中排除极少使用的内容 +// Windows 头文件 +#include diff --git a/DllDemo1/DllDemo1/pch.cpp b/DllDemo1/DllDemo1/pch.cpp new file mode 100644 index 0000000..db1a479 --- /dev/null +++ b/DllDemo1/DllDemo1/pch.cpp @@ -0,0 +1,5 @@ +// pch.cpp: 与预编译标头对应的源文件 + +#include "pch.h" + +// 当使用预编译的头时,需要使用此源文件,编译才能成功。 diff --git a/DllDemo1/DllDemo1/pch.h b/DllDemo1/DllDemo1/pch.h new file mode 100644 index 0000000..aa4549e --- /dev/null +++ b/DllDemo1/DllDemo1/pch.h @@ -0,0 +1,13 @@ +// pch.h: 这是预编译标头文件。 +// 下方列出的文件仅编译一次,提高了将来生成的生成性能。 +// 这还将影响 IntelliSense 性能,包括代码完成和许多代码浏览功能。 +// 但是,如果此处列出的文件中的任何一个在生成之间有更新,它们全部都将被重新编译。 +// 请勿在此处添加要频繁更新的文件,这将使得性能优势无效。 + +#ifndef PCH_H +#define PCH_H + +// 添加要在此处预编译的标头 +#include "framework.h" + +#endif //PCH_H diff --git a/DllDemo1/IsInvoketest/Debug/IsInvoketest.exe.recipe b/DllDemo1/IsInvoketest/Debug/IsInvoketest.exe.recipe new file mode 100644 index 0000000..b70475e --- /dev/null +++ b/DllDemo1/IsInvoketest/Debug/IsInvoketest.exe.recipe @@ -0,0 +1,11 @@ + + + + + D:\study\DllDemo1\Debug\IsInvoketest.exe + + + + + + \ No newline at end of file diff --git a/DllDemo1/IsInvoketest/Debug/IsInvoketest.ilk b/DllDemo1/IsInvoketest/Debug/IsInvoketest.ilk new file mode 100644 index 0000000..95b0a52 Binary files /dev/null and b/DllDemo1/IsInvoketest/Debug/IsInvoketest.ilk differ diff --git a/DllDemo1/IsInvoketest/Debug/IsInvoketest.log b/DllDemo1/IsInvoketest/Debug/IsInvoketest.log new file mode 100644 index 0000000..319b7c1 --- /dev/null +++ b/DllDemo1/IsInvoketest/Debug/IsInvoketest.log @@ -0,0 +1 @@ + IsInvoketest.vcxproj -> D:\study\DllDemo1\Debug\IsInvoketest.exe diff --git a/DllDemo1/IsInvoketest/Debug/IsInvoketest.obj b/DllDemo1/IsInvoketest/Debug/IsInvoketest.obj new file mode 100644 index 0000000..ebc64f8 Binary files /dev/null and b/DllDemo1/IsInvoketest/Debug/IsInvoketest.obj differ diff --git a/DllDemo1/IsInvoketest/Debug/IsInvoketest.tlog/CL.command.1.tlog b/DllDemo1/IsInvoketest/Debug/IsInvoketest.tlog/CL.command.1.tlog new file mode 100644 index 0000000..c4bb78e Binary files /dev/null and b/DllDemo1/IsInvoketest/Debug/IsInvoketest.tlog/CL.command.1.tlog differ diff --git a/DllDemo1/IsInvoketest/Debug/IsInvoketest.tlog/CL.read.1.tlog b/DllDemo1/IsInvoketest/Debug/IsInvoketest.tlog/CL.read.1.tlog new file mode 100644 index 0000000..e0eaa90 Binary files /dev/null and b/DllDemo1/IsInvoketest/Debug/IsInvoketest.tlog/CL.read.1.tlog differ diff --git a/DllDemo1/IsInvoketest/Debug/IsInvoketest.tlog/CL.write.1.tlog b/DllDemo1/IsInvoketest/Debug/IsInvoketest.tlog/CL.write.1.tlog new file mode 100644 index 0000000..fd67fee Binary files /dev/null and b/DllDemo1/IsInvoketest/Debug/IsInvoketest.tlog/CL.write.1.tlog differ diff --git a/DllDemo1/IsInvoketest/Debug/IsInvoketest.tlog/IsInvoketest.lastbuildstate b/DllDemo1/IsInvoketest/Debug/IsInvoketest.tlog/IsInvoketest.lastbuildstate new file mode 100644 index 0000000..1736a6b --- /dev/null +++ b/DllDemo1/IsInvoketest/Debug/IsInvoketest.tlog/IsInvoketest.lastbuildstate @@ -0,0 +1,2 @@ +PlatformToolSet=v142:VCToolArchitecture=Native32Bit:VCToolsVersion=14.29.30133:TargetPlatformVersion=10.0.19041.0: +Debug|Win32|D:\study\DllDemo1\| diff --git a/DllDemo1/IsInvoketest/Debug/IsInvoketest.tlog/link.command.1.tlog b/DllDemo1/IsInvoketest/Debug/IsInvoketest.tlog/link.command.1.tlog new file mode 100644 index 0000000..ad357cf Binary files /dev/null and b/DllDemo1/IsInvoketest/Debug/IsInvoketest.tlog/link.command.1.tlog differ diff --git a/DllDemo1/IsInvoketest/Debug/IsInvoketest.tlog/link.read.1.tlog b/DllDemo1/IsInvoketest/Debug/IsInvoketest.tlog/link.read.1.tlog new file mode 100644 index 0000000..d8996a8 Binary files /dev/null and b/DllDemo1/IsInvoketest/Debug/IsInvoketest.tlog/link.read.1.tlog differ diff --git a/DllDemo1/IsInvoketest/Debug/IsInvoketest.tlog/link.write.1.tlog b/DllDemo1/IsInvoketest/Debug/IsInvoketest.tlog/link.write.1.tlog new file mode 100644 index 0000000..a177970 Binary files /dev/null and b/DllDemo1/IsInvoketest/Debug/IsInvoketest.tlog/link.write.1.tlog differ diff --git a/DllDemo1/IsInvoketest/Debug/vc142.idb b/DllDemo1/IsInvoketest/Debug/vc142.idb new file mode 100644 index 0000000..8b71f50 Binary files /dev/null and b/DllDemo1/IsInvoketest/Debug/vc142.idb differ diff --git a/DllDemo1/IsInvoketest/Debug/vc142.pdb b/DllDemo1/IsInvoketest/Debug/vc142.pdb new file mode 100644 index 0000000..c9ed438 Binary files /dev/null and b/DllDemo1/IsInvoketest/Debug/vc142.pdb differ diff --git a/DllDemo1/IsInvoketest/IsInvoketest.cpp b/DllDemo1/IsInvoketest/IsInvoketest.cpp new file mode 100644 index 0000000..886b6b9 --- /dev/null +++ b/DllDemo1/IsInvoketest/IsInvoketest.cpp @@ -0,0 +1,29 @@ +// IsInvoketest.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。 +// +#include "dll.h" +#include +#pragma comment(lib,"DllDemo1.lib") + +int main() +{ + int arr[] = { 3,6,7,8 }; + int nLen = sizeof(arr) / sizeof(int); + int nTotal = convert_array(arr, nLen); + std::cout << "数组元素求和结果:" << nTotal << std::endl; + std::cout << "数组元素新值:" << std::endl; + for (int i = 0; i < nLen; i++) + { + std::cout << arr[i] << ","; + } +} + +// 运行程序: Ctrl + F5 或调试 >“开始执行(不调试)”菜单 +// 调试程序: F5 或调试 >“开始调试”菜单 + +// 入门使用技巧: +// 1. 使用解决方案资源管理器窗口添加/管理文件 +// 2. 使用团队资源管理器窗口连接到源代码管理 +// 3. 使用输出窗口查看生成输出和其他消息 +// 4. 使用错误列表窗口查看错误 +// 5. 转到“项目”>“添加新项”以创建新的代码文件,或转到“项目”>“添加现有项”以将现有代码文件添加到项目 +// 6. 将来,若要再次打开此项目,请转到“文件”>“打开”>“项目”并选择 .sln 文件 diff --git a/DllDemo1/IsInvoketest/IsInvoketest.vcxproj b/DllDemo1/IsInvoketest/IsInvoketest.vcxproj new file mode 100644 index 0000000..1f9231a --- /dev/null +++ b/DllDemo1/IsInvoketest/IsInvoketest.vcxproj @@ -0,0 +1,150 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 16.0 + Win32Proj + {bcf609ac-c6ca-43b2-b070-7cc246a28cdd} + IsInvoketest + 10.0 + + + + Application + true + v142 + Unicode + + + Application + false + v142 + true + Unicode + + + Application + true + v142 + Unicode + + + Application + false + v142 + true + Unicode + + + + + + + + + + + + + + + + + + + + + true + + + false + + + true + + + false + + + + Level3 + true + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + D:\study\DllDemo1\DllDemo1;%(AdditionalIncludeDirectories) + + + Console + true + DllDemo1.lib;%(AdditionalDependencies) + D:\study\DllDemo1\Debug;%(AdditionalLibraryDirectories) + + + + + Level3 + true + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + Level3 + true + _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + + + + + \ No newline at end of file diff --git a/DllDemo1/IsInvoketest/IsInvoketest.vcxproj.filters b/DllDemo1/IsInvoketest/IsInvoketest.vcxproj.filters new file mode 100644 index 0000000..a2fdb27 --- /dev/null +++ b/DllDemo1/IsInvoketest/IsInvoketest.vcxproj.filters @@ -0,0 +1,22 @@ + + + + + {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/DllDemo1/IsInvoketest/IsInvoketest.vcxproj.user b/DllDemo1/IsInvoketest/IsInvoketest.vcxproj.user new file mode 100644 index 0000000..0f14913 --- /dev/null +++ b/DllDemo1/IsInvoketest/IsInvoketest.vcxproj.user @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/DllDemo1/XsInvoketest/Debug/XsInvoketest.exe.recipe b/DllDemo1/XsInvoketest/Debug/XsInvoketest.exe.recipe new file mode 100644 index 0000000..cc8c654 --- /dev/null +++ b/DllDemo1/XsInvoketest/Debug/XsInvoketest.exe.recipe @@ -0,0 +1,11 @@ + + + + + D:\study\DllDemo1\Debug\XsInvoketest.exe + + + + + + \ No newline at end of file diff --git a/DllDemo1/XsInvoketest/Debug/XsInvoketest.ilk b/DllDemo1/XsInvoketest/Debug/XsInvoketest.ilk new file mode 100644 index 0000000..cb477b8 Binary files /dev/null and b/DllDemo1/XsInvoketest/Debug/XsInvoketest.ilk differ diff --git a/DllDemo1/XsInvoketest/Debug/XsInvoketest.log b/DllDemo1/XsInvoketest/Debug/XsInvoketest.log new file mode 100644 index 0000000..cd52598 --- /dev/null +++ b/DllDemo1/XsInvoketest/Debug/XsInvoketest.log @@ -0,0 +1,2 @@ + XsInvoketest.cpp + XsInvoketest.vcxproj -> D:\study\DllDemo1\Debug\XsInvoketest.exe diff --git a/DllDemo1/XsInvoketest/Debug/XsInvoketest.obj b/DllDemo1/XsInvoketest/Debug/XsInvoketest.obj new file mode 100644 index 0000000..d9ea26b Binary files /dev/null and b/DllDemo1/XsInvoketest/Debug/XsInvoketest.obj differ diff --git a/DllDemo1/XsInvoketest/Debug/XsInvoketest.tlog/CL.command.1.tlog b/DllDemo1/XsInvoketest/Debug/XsInvoketest.tlog/CL.command.1.tlog new file mode 100644 index 0000000..bb446da Binary files /dev/null and b/DllDemo1/XsInvoketest/Debug/XsInvoketest.tlog/CL.command.1.tlog differ diff --git a/DllDemo1/XsInvoketest/Debug/XsInvoketest.tlog/CL.read.1.tlog b/DllDemo1/XsInvoketest/Debug/XsInvoketest.tlog/CL.read.1.tlog new file mode 100644 index 0000000..11cffc0 Binary files /dev/null and b/DllDemo1/XsInvoketest/Debug/XsInvoketest.tlog/CL.read.1.tlog differ diff --git a/DllDemo1/XsInvoketest/Debug/XsInvoketest.tlog/CL.write.1.tlog b/DllDemo1/XsInvoketest/Debug/XsInvoketest.tlog/CL.write.1.tlog new file mode 100644 index 0000000..ae28366 Binary files /dev/null and b/DllDemo1/XsInvoketest/Debug/XsInvoketest.tlog/CL.write.1.tlog differ diff --git a/DllDemo1/XsInvoketest/Debug/XsInvoketest.tlog/XsInvoketest.lastbuildstate b/DllDemo1/XsInvoketest/Debug/XsInvoketest.tlog/XsInvoketest.lastbuildstate new file mode 100644 index 0000000..1736a6b --- /dev/null +++ b/DllDemo1/XsInvoketest/Debug/XsInvoketest.tlog/XsInvoketest.lastbuildstate @@ -0,0 +1,2 @@ +PlatformToolSet=v142:VCToolArchitecture=Native32Bit:VCToolsVersion=14.29.30133:TargetPlatformVersion=10.0.19041.0: +Debug|Win32|D:\study\DllDemo1\| diff --git a/DllDemo1/XsInvoketest/Debug/XsInvoketest.tlog/link.command.1.tlog b/DllDemo1/XsInvoketest/Debug/XsInvoketest.tlog/link.command.1.tlog new file mode 100644 index 0000000..fd31b94 Binary files /dev/null and b/DllDemo1/XsInvoketest/Debug/XsInvoketest.tlog/link.command.1.tlog differ diff --git a/DllDemo1/XsInvoketest/Debug/XsInvoketest.tlog/link.read.1.tlog b/DllDemo1/XsInvoketest/Debug/XsInvoketest.tlog/link.read.1.tlog new file mode 100644 index 0000000..6a0321b Binary files /dev/null and b/DllDemo1/XsInvoketest/Debug/XsInvoketest.tlog/link.read.1.tlog differ diff --git a/DllDemo1/XsInvoketest/Debug/XsInvoketest.tlog/link.write.1.tlog b/DllDemo1/XsInvoketest/Debug/XsInvoketest.tlog/link.write.1.tlog new file mode 100644 index 0000000..f3b8ca1 Binary files /dev/null and b/DllDemo1/XsInvoketest/Debug/XsInvoketest.tlog/link.write.1.tlog differ diff --git a/DllDemo1/XsInvoketest/Debug/vc142.idb b/DllDemo1/XsInvoketest/Debug/vc142.idb new file mode 100644 index 0000000..1b5b4b0 Binary files /dev/null and b/DllDemo1/XsInvoketest/Debug/vc142.idb differ diff --git a/DllDemo1/XsInvoketest/Debug/vc142.pdb b/DllDemo1/XsInvoketest/Debug/vc142.pdb new file mode 100644 index 0000000..129e8f4 Binary files /dev/null and b/DllDemo1/XsInvoketest/Debug/vc142.pdb differ diff --git a/DllDemo1/XsInvoketest/XsInvoketest.cpp b/DllDemo1/XsInvoketest/XsInvoketest.cpp new file mode 100644 index 0000000..5801ebd --- /dev/null +++ b/DllDemo1/XsInvoketest/XsInvoketest.cpp @@ -0,0 +1,42 @@ +// XsInvoketest.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。 +// + +#include +#include +typedef int(*PTR)(int* data, int len); +int main() +{ + HINSTANCE hDll; + PTR ptr; + hDll = LoadLibrary(L"DllDemo1"); + if (hDll != NULL) + { + ptr = (PTR)GetProcAddress(hDll, "convert_array"); + if (ptr != NULL) + { + int nArr[] = { 1,2,4,6 }; + int nlen = sizeof(nArr) / sizeof(int); + int nRet; + + nRet = ptr(nArr, nlen); + std::cout << "返回值:" << nRet << std::endl; + std::cout << "数组新值: "; + for (int i = 0; i < nlen; ++i) + { + std::cout << nArr[i] << ","; + } + FreeLibrary(hDll); + } + } +} + +// 运行程序: Ctrl + F5 或调试 >“开始执行(不调试)”菜单 +// 调试程序: F5 或调试 >“开始调试”菜单 + +// 入门使用技巧: +// 1. 使用解决方案资源管理器窗口添加/管理文件 +// 2. 使用团队资源管理器窗口连接到源代码管理 +// 3. 使用输出窗口查看生成输出和其他消息 +// 4. 使用错误列表窗口查看错误 +// 5. 转到“项目”>“添加新项”以创建新的代码文件,或转到“项目”>“添加现有项”以将现有代码文件添加到项目 +// 6. 将来,若要再次打开此项目,请转到“文件”>“打开”>“项目”并选择 .sln 文件 diff --git a/DllDemo1/XsInvoketest/XsInvoketest.vcxproj b/DllDemo1/XsInvoketest/XsInvoketest.vcxproj new file mode 100644 index 0000000..e3b3ece --- /dev/null +++ b/DllDemo1/XsInvoketest/XsInvoketest.vcxproj @@ -0,0 +1,147 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 16.0 + Win32Proj + {0bb5461b-cee1-4d04-992d-90d37397e972} + XsInvoketest + 10.0 + + + + Application + true + v142 + Unicode + + + Application + false + v142 + true + Unicode + + + Application + true + v142 + Unicode + + + Application + false + v142 + true + Unicode + + + + + + + + + + + + + + + + + + + + + true + + + false + + + true + + + false + + + + Level3 + true + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + Level3 + true + _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + + + + + \ No newline at end of file diff --git a/DllDemo1/XsInvoketest/XsInvoketest.vcxproj.filters b/DllDemo1/XsInvoketest/XsInvoketest.vcxproj.filters new file mode 100644 index 0000000..1ab76a3 --- /dev/null +++ b/DllDemo1/XsInvoketest/XsInvoketest.vcxproj.filters @@ -0,0 +1,22 @@ + + + + + {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/DllDemo1/XsInvoketest/XsInvoketest.vcxproj.user b/DllDemo1/XsInvoketest/XsInvoketest.vcxproj.user new file mode 100644 index 0000000..0f14913 --- /dev/null +++ b/DllDemo1/XsInvoketest/XsInvoketest.vcxproj.user @@ -0,0 +1,4 @@ + + + + \ No newline at end of file