1. #include <windows.h>
  2.  
  3. typedef struct {
  4.   long a;
  5.   long b;
  6.   long c;
  7.   long d;
  8.   long e;
  9.   long f;
  10. } Data;
  11.  
  12. typedef int (WINAPIV* LPFN_PROJECTORMAIN) (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow, Data *data);
  13.  
  14. int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow){
  15.   HINSTANCE hLib = LoadLibraryA("proj.dll");
  16.   if (hLib){
  17.     LPFN_PROJECTORMAIN fnMain = (LPFN_PROJECTORMAIN)GetProcAddress(hLib, "ProjectorMain");
  18.     if (fnMain){
  19.       Data data = {0};
  20.  
  21.       // use basename of exe file for loading DIR/DXR/DCR movie
  22.       char exe[MAX_PATH];
  23.       GetModuleFileNameA(NULL, exe, MAX_PATH);
  24.       char * basename = strrchr(exe, '\\')+1;
  25.       char * p = strrchr(basename, '.');
  26.       if (p) *p = 0;
  27.       fnMain(hInstance, hPrevInstance, basename, nCmdShow, &data);
  28.     }
  29.     FreeLibrary(hLib);
  30.   }
  31.   return 0;
  32. }
  33.  
[raw code]