настроить загрузку задержки в мой плагин вчера:Как остановить загруженную от задержки DLL из-за ошибки системы «Отсутствует на вашем компьютере»?
#ifdef _WIN32
#pragma warning (disable : 4100) /* Disable Unreferenced parameter warning */
#include <windows.h>
#include <delayimp.h>
#endif
...
// Configuration Properties/Linker/Input/Additional Dependencies: ./lib/libcurl.lib;./lib/libxml2.lib;./lib/iconv.lib;./lib/zlib1.lib;%(AdditionalDependencies)
// Configuration Properties/Linker/Input /Delay Loaded Dlls: libcurl;libxml2;iconv;zlib1;%(DelayLoadDLLs)
#include "curl.h"
#include "HTMLparser.h"
#include "xpath.h"
#ifdef _WIN32
#pragma comment(lib, "libcurl")
#pragma comment(lib, "iconv")
#pragma comment(lib, "libxml2")
#pragma comment(lib, "zlib1")
#endif
[1]
И я инициализации библиотеки DLL на плагин нагрузки:
#ifdef _WIN32
SetDllDirectory(L"./plugins/ts3websitepreview/");
if (FAILED(__HrLoadAllImportsForDll("libcurl.dll"))) {
ts3Functions.logMessage("Could not load curl.", LogLevel_ERROR, "Plugin", 0);
return 1;
}
if (FAILED(__HrLoadAllImportsForDll("libxml2.dll"))) {
ts3Functions.logMessage("Could not load libxml.", LogLevel_ERROR, "Plugin", 0);
return 1;
}
if (FAILED(__HrLoadAllImportsForDll("zlib1.dll"))) {
ts3Functions.logMessage("Could not load zlib1.", LogLevel_ERROR, "Plugin", 0);
return 1;
}
if (FAILED(__HrLoadAllImportsForDll("iconv.dll"))) {
ts3Functions.logMessage("Could not load iconv.", LogLevel_ERROR, "Plugin", 0);
return 1;
}
#endif
[2]
Вот мой журнал построения после добавления утверждений прагмы:
1>------ Build started: Project: ts3websitepreview, Configuration: Debug Win32 ------
1>Build started 2016-06-15 06:35:23 PM.
1>InitializeBuildStatus:
1> Creating "Debug\ts3websitepreview.unsuccessfulbuild" because "AlwaysCreate" was specified.
1>ClCompile:
1> plugin.c
1>ManifestResourceCompile:
1> All outputs are up-to-date.
1>Link:
1> Creating library .\ts3websitepreview.lib and object .\ts3websitepreview.exp
1>LINK : warning LNK4199: /DELAYLOAD:libcurl ignored; no imports found from libcurl
1>LINK : warning LNK4199: /DELAYLOAD:libxml2 ignored; no imports found from libxml2
1>LINK : warning LNK4199: /DELAYLOAD:iconv ignored; no imports found from iconv
1>LINK : warning LNK4199: /DELAYLOAD:zlib1 ignored; no imports found from zlib1
1>Manifest:
1> All outputs are up-to-date.
1>LinkEmbedManifest:
1> All outputs are up-to-date.
1> ts3websitepreview.vcxproj -> .\ts3websitepreview.dll
1>FinalizeBuildStatus:
1> Deleting file "Debug\ts3websitepreview.unsuccessfulbuild".
1> Touching "Debug\ts3websitepreview.lastbuildstate".
1>
1>Build succeeded.
1>
1>Time Elapsed 00:00:01.60
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
Который сразу изменен на:
1>------ Build started: Project: ts3websitepreview, Configuration: Debug Win32 ------
1>Build started 2016-06-15 06:39:54 PM.
1>InitializeBuildStatus:
1> Creating "Debug\ts3websitepreview.unsuccessfulbuild" because "AlwaysCreate" was specified.
1>ClCompile:
1> plugin.c
1>ManifestResourceCompile:
1> All outputs are up-to-date.
1>Manifest:
1> All outputs are up-to-date.
1>LinkEmbedManifest:
1> All outputs are up-to-date.
1> ts3websitepreview.vcxproj -> .\ts3websitepreview.dll
1>FinalizeBuildStatus:
1> Deleting file "Debug\ts3websitepreview.unsuccessfulbuild".
1> Touching "Debug\ts3websitepreview.lastbuildstate".
1>
1>Build succeeded.
1>
1>Time Elapsed 00:00:00.71
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
После очередного строить с без изменения кода.
Но вместо этого, он все еще пытается загрузить DLL, прежде чем плагин даже инициализирует, давая мне:
ts3client_win32.exe - System Error
The program can't start because libcurl.dll is missing from your computer. Try reinstalling the program to fix this problem.
Я использовал учебные пособия here и here для отсроченного нагрузки. Я также прочитал вопросы here, here, here и here, но никто не решил мою проблему.
В Visual Studio «Свойства проекта -> Коннектор -> Вход -> Задержка загрузки DLL» вы должны установить «libcurl.dll; iconv.dll» и т. Д. –
@BarmakShemirani Я уже сделал это, как вы можете видеть на строка 10 моего первого примера кода или строки 21 или моего фактического кода. – NobleUplift
Вы должны изменить свойства проекта, это не строка кода. Я не вижу этого нигде в вашем вопросе или ссылках. Вы поставили слишком много ссылок, я не уверен, что вы тоже имеете в виду. Изменение параметра «Свойства проекта» - это все, что вам нужно. –