dev/c/undef_ref/win/test_dll.c

20 lines
352 B
C

#include <stdio.h>
#include <windows.h>
test_func ()
{
puts ("test_func() called successfully! ;-)");
}
typedef void (*pfunc)();
void dll_main ()
{
printf ("Calling shared_func() from main: ");
HMODULE lib = LoadLibrary ("shared.dll");
pfunc shared_func = (pfunc)GetProcAddress(lib, "shared_func");
shared_func ();
FreeLibrary (lib);
}