include "stdafx.h" #include <windows.h> #include <stdio.h> typedef char* PCHAR; int main(int argc, char* argv[]) { PCHAR szDllName = "..\\..\\OBJ\\ExportChartData.dll"; HINSTANCE hInstance = LoadLibrary(szDllName); char *s = new char[255]; if (hInstance != NULL) { void (*f)(int, char *) = (void (*)(int, char *))GetProcAddress(hInstance, "SayHello"); f(1, s); printf("%s",s); } FreeLibrary(hInstance); delete[]s; return 0; } |
|