拓冰建站拓冰建站
首页 / 资讯中心 / 正文

C++-DLL开发环境搭建

一.VisualStudio下载WindowsSDK二.创建vcxproj文件?xml version1.0 encodingutf-8? Project DefaultTargetsBuild ToolsVersion15.0 xmlnshttp://schemas.microsoft.com/developer/msbuild/2003 PropertyGroup LabelGlobals ProjectGuid{0b831b6d-7f3d-46d6-acf2-db806005b325}/ProjectGuid KeywordDynamicLibrary/Keyword RootNamespaceBLDllPlus/RootNamespace DefaultLanguagezh-CN/DefaultLanguage MinimumVisualStudioVersion14.0/MinimumVisualStudioVersion WindowsTargetPlatformVersion10.0.22621.0/WindowsTargetPlatformVersion WindowsTargetPlatformMinVersion10.0.17763.0/WindowsTargetPlatformMinVersion ApplicationTypeRevision10.0/ApplicationTypeRevision /PropertyGroup PropertyGroup Condition$(Configuration)|$(Platform)Debug|x64 LabelConfiguration ConfigurationTypeDynamicLibrary/ConfigurationType UseDebugLibrariestrue/UseDebugLibraries PlatformToolsetv143/PlatformToolset /PropertyGroup PropertyGroup Condition$(Configuration)|$(Platform)Release|x64 LabelConfiguration ConfigurationTypeDynamicLibrary/ConfigurationType UseDebugLibrariesfalse/UseDebugLibraries WholeProgramOptimizationtrue/WholeProgramOptimization PlatformToolsetv143/PlatformToolset /PropertyGroup ItemGroup LabelProjectConfigurations ProjectConfiguration IncludeDebug|x64 ConfigurationDebug/Configuration Platformx64/Platform /ProjectConfiguration ProjectConfiguration IncludeRelease|x64 ConfigurationRelease/Configuration Platformx64/Platform /ProjectConfiguration /ItemGroup ItemGroup ClCompile Includedllmain.cpp / /ItemGroup Import Project$(VCTargetsPath)\Microsoft.Cpp.Default.props / Import Project$(VCTargetsPath)\Microsoft.Cpp.props / Import Project$(VCTargetsPath)\Microsoft.Cpp.targets / /Project三.创建DllMain函数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; }
分享:

看完干货,该让你的企业上线了

免费需求沟通 · 48 小时内出具建站方案 · 河南本地可上门