HINSTANCE hMyDLL = LoadLibrary(L"ClassLibrary1.dll");
if (NULL == hMyDLL) {
std::cout << "LoadLibrary failed\n";
getchar();
return -1;
}
typedef int (WINAPI * function) ();
function f = (function)GetProcAddress(hMyDLL, "Class1.test");
if (NULL == f) {
std::cout << ":(\n";
}
namespace ClassLibrary1 {
public class Class1 {
public static int test() {
return 5;
}
}
}