#include <windows.h>
typedef struct {
long a;
long b;
long c;
long d;
long e;
long f;
} Data;
typedef int (WINAPIV* LPFN_PROJECTORMAIN) (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow, Data *data);
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow){
HINSTANCE hLib = LoadLibraryA("proj.dll");
if (hLib){
LPFN_PROJECTORMAIN fnMain = (LPFN_PROJECTORMAIN)GetProcAddress(hLib, "ProjectorMain");
if (fnMain){
Data data = {0};
// use basename of exe file for loading DIR/DXR/DCR movie
char exe[MAX_PATH];
GetModuleFileNameA(NULL, exe, MAX_PATH);
char * basename = strrchr(exe, '\\')+1;
char * p = strrchr(basename, '.');
if (p) *p = 0;
fnMain(hInstance, hPrevInstance, basename, nCmdShow, &data);
}
FreeLibrary(hLib);
}
return 0;
}