#include <iostream>
#include <Windows.h>
typedef void(__cdecl* DEBUG)();
int main() {
HMODULE hModule = LoadLibraryA("HttCppLibrary.dll");
if (hModule != NULL) {
auto debug = (DEBUG)GetProcAddress(hModule, "DEBUG");
debug();
std::cout << "debug is called\n";
FreeLibrary(hModule);
}
else {
std::cout << "Failed to load DLL" << std::endl;
}
return 0;
}
#include <iostream>
#include <Windows.h>
typedef void(__cdecl* DEBUG)();
int main() {
HMODULE hModule = LoadLibraryA("HttCppLibrary.dll");
if (hModule != NULL) {
auto debug = (DEBUG)GetProcAddress(hModule, "DEBUG");
debug();
std::cout << "debug is called\n";
FreeLibrary(hModule);
}
else {
std::cout << "Failed to load DLL" << std::endl;
}
return 0;
}