From 42cdbe2cd0900122ceef95acb95a934b5233897b Mon Sep 17 00:00:00 2001 From: "Scott E. Graves" Date: Tue, 14 Feb 2017 21:50:58 -0600 Subject: [PATCH] Fix SiaDrive.Api build --- SiaDrive.Api/ReadMe.txt | 7 ++--- SiaDrive.Api/Resource.h | 6 ++-- SiaDrive.Api/SiaDrive.Api.vcxproj | 27 ++++++++--------- SiaDrive.Api/SiaDrive.Api.vcxproj.filters | 36 +++++++++++------------ SiaDrive.Api/dllmain.cpp | 10 ++----- SiaDrive.Api/stdafx.h | 1 + 6 files changed, 38 insertions(+), 49 deletions(-) diff --git a/SiaDrive.Api/ReadMe.txt b/SiaDrive.Api/ReadMe.txt index fdfe9a1..97ebaf8 100644 --- a/SiaDrive.Api/ReadMe.txt +++ b/SiaDrive.Api/ReadMe.txt @@ -23,12 +23,9 @@ SiaDrive.Api.vcxproj.filters similar extensions under a specific node (for e.g. ".cpp" files are associated with the "Source Files" filter). -SiaDrive.Api.h - This is the main header file for the DLL. It declares the - CSiaDriveApiApp class. - SiaDrive.Api.cpp - This is the main DLL source file. It contains the class CSiaDriveApiApp. + This is the main DLL source file that contains the definition of + DllMain(). SiaDrive.Api.rc This is a listing of all of the Microsoft Windows resources that the diff --git a/SiaDrive.Api/Resource.h b/SiaDrive.Api/Resource.h index 6daa167..0cae8ce 100644 --- a/SiaDrive.Api/Resource.h +++ b/SiaDrive.Api/Resource.h @@ -9,9 +9,9 @@ #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 1000 -#define _APS_NEXT_CONTROL_VALUE 1000 -#define _APS_NEXT_SYMED_VALUE 1000 +#define _APS_NEXT_RESOURCE_VALUE 2000 +#define _APS_NEXT_CONTROL_VALUE 2000 +#define _APS_NEXT_SYMED_VALUE 2000 #define _APS_NEXT_COMMAND_VALUE 32771 #endif #endif diff --git a/SiaDrive.Api/SiaDrive.Api.vcxproj b/SiaDrive.Api/SiaDrive.Api.vcxproj index 7ebf0e9..6452594 100644 --- a/SiaDrive.Api/SiaDrive.Api.vcxproj +++ b/SiaDrive.Api/SiaDrive.Api.vcxproj @@ -90,15 +90,13 @@ Use Level3 Disabled - WIN32;_WINDOWS;_DEBUG;_AFXEXT;TTMATH_NOASM;CURL_STATICLIB;%(PreprocessorDefinitions) + CURL_STATICLIB;CURL_DISABLE_LDAP;TTMATH_NOASM;WIN32;_WINDOWS;_DEBUG;_AFXEXT;%(PreprocessorDefinitions) true - ..\3rd-party\ttmath-0.9.3;..\3rd-party\curl-7.52.1\include;.\; + ..\3rd-party\ttmath-0.9.3;.\;..\3rd-party\curl-7.52.1\include;%(AdditionalIncludeDirectories) Windows .\SiaDrive.Api.def - ..\3rd-party\curl-7.52.1\build\Win32\VC14\LIB Debug\libcurld.lib - /verbose:lib %(AdditionalOptions) false @@ -115,9 +113,9 @@ Use Level3 Disabled - TTMATH_NOASM;_AFXEXT;CURL_STATICLIB;_WINDOWS;_DEBUG;_USRDLL;%(PreprocessorDefinitions) + CURL_STATICLIB;CURL_DISABLE_LDAP;TTMATH_NOASM;_WINDOWS;_DEBUG;_AFXEXT;%(PreprocessorDefinitions) true - ..\3rd-party\ttmath-0.9.3;..\3rd-party\curl-7.52.1\include;.\ + ..\3rd-party\ttmath-0.9.3;.\;..\3rd-party\curl-7.52.1\include;%(AdditionalIncludeDirectories) Windows @@ -140,16 +138,15 @@ MaxSpeed true true - WIN32;_WINDOWS;_LIB;TTMATH_NOASM;_AFXEXT;CURL_STATICLIB;WIN32;_WINDOWS;NDEBUG;%(PreprocessorDefinitions) + CURL_STATICLIB;CURL_DISABLE_LDAP;TTMATH_NOASM;WIN32;_WINDOWS;NDEBUG;_AFXEXT;%(PreprocessorDefinitions) true - ..\3rd-party\ttmath-0.9.3;..\3rd-party\curl-7.52.1\include;.\; + ..\3rd-party\ttmath-0.9.3;.\;..\3rd-party\curl-7.52.1\include;%(AdditionalIncludeDirectories) Windows true true .\SiaDrive.Api.def - ..\3rd-party\curl-7.52.1\build\Win32\VC14\LIB Release\libcurl.lib false @@ -168,9 +165,9 @@ MaxSpeed true true - TTMATH_NOASM;_AFXEXT;CURL_STATICLIB;_WINDOWS;NDEBUG;%(PreprocessorDefinitions) + CURL_STATICLIB;CURL_DISABLE_LDAP;TTMATH_NOASM;_WINDOWS;NDEBUG;_AFXEXT;%(PreprocessorDefinitions) true - ..\3rd-party\ttmath-0.9.3;..\3rd-party\curl-7.52.1\include;.\ + ..\3rd-party\ttmath-0.9.3;.\;..\3rd-party\curl-7.52.1\include;%(AdditionalIncludeDirectories) Windows @@ -222,6 +219,10 @@ Create + + + + @@ -232,10 +233,6 @@ - - - - diff --git a/SiaDrive.Api/SiaDrive.Api.vcxproj.filters b/SiaDrive.Api/SiaDrive.Api.vcxproj.filters index cec306d..8a9ec9c 100644 --- a/SiaDrive.Api/SiaDrive.Api.vcxproj.filters +++ b/SiaDrive.Api/SiaDrive.Api.vcxproj.filters @@ -21,13 +21,16 @@ Source Files + + Source Files + Source Files Source Files - + Source Files @@ -36,22 +39,27 @@ Source Files - - Source Files - - + Source Files Source Files - + Source Files - + Source Files + + + Source Files + + + Resource Files + + Header Files @@ -62,6 +70,9 @@ Header Files + + Header Files + Header Files @@ -71,21 +82,10 @@ Header Files - - Header Files - Header Files - - - Source Files - - - Resource Files - - Resource Files diff --git a/SiaDrive.Api/dllmain.cpp b/SiaDrive.Api/dllmain.cpp index 73a121f..ec8d217 100644 --- a/SiaDrive.Api/dllmain.cpp +++ b/SiaDrive.Api/dllmain.cpp @@ -4,8 +4,6 @@ #include "stdafx.h" #include #include -#include - #ifdef _DEBUG #define new DEBUG_NEW @@ -22,7 +20,7 @@ DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved) if (dwReason == DLL_PROCESS_ATTACH) { TRACE0("SiaDrive.Api.DLL Initializing!\n"); - + // Extension DLL one-time initialization if (!AfxInitExtensionModule(SiaDriveApiDLL, hInstance)) return 0; @@ -53,18 +51,14 @@ DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved) { return FALSE; } - - curl_global_init(CURL_GLOBAL_WIN32); + } else if (dwReason == DLL_PROCESS_DETACH) { TRACE0("SiaDrive.Api.DLL Terminating!\n"); - curl_global_cleanup(); - // Terminate the library before destructors are called AfxTermExtensionModule(SiaDriveApiDLL); - } return 1; // ok } diff --git a/SiaDrive.Api/stdafx.h b/SiaDrive.Api/stdafx.h index 5550070..9277429 100644 --- a/SiaDrive.Api/stdafx.h +++ b/SiaDrive.Api/stdafx.h @@ -7,6 +7,7 @@ #ifndef VC_EXTRALEAN #define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers #endif + #include "targetver.h" #define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS // some CString constructors will be explicit