/*
  test_caller.cpp
*/

#include <windows.h>
#include <stdio.h>

#include "test_dll.h"

#define LIBNAME "test_dll.dll"

#define FUNC_TEST "test"
typedef int (WINAPI *func_test)(int);

int main(int ac, char **av)
{
  HMODULE hmodule = LoadLibrary(LIBNAME);
  if(!hmodule){
    fprintf(stderr, "cannot load module: %s\n", LIBNAME);
    return 1;
  }
  func_test test = (func_test)GetProcAddress(hmodule, FUNC_TEST);
  if(!test){
    fprintf(stderr, "cannot get proccess: %s\n", FUNC_TEST);
    return 2;
  }
  fprintf(stdout, "test: %d\n", test(6));
  FreeLibrary(hmodule);
  return 0;
}