// GOLD.cpp : Defines the entry point for the DLL application. // #include "stdafx.h" #include "GOLD.h" BOOL APIENTRY DllMain( HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserved ) { switch (ul_reason_for_call) { case DLL_PROCESS_ATTACH: case DLL_THREAD_ATTACH: case DLL_THREAD_DETACH: case DLL_PROCESS_DETACH: break; } return TRUE; } // This is an example of an exported variable GOLD_API int nGOLD=0; // This is an example of an exported function. GOLD_API int fnGOLD(void) { return 42; } #define MT4_EXPFUNC __declspec(dllexport) typedef BOOL (*BGBOOL)(char*, DWORD*, DWORD, BOOL); MT4_EXPFUNC bool __stdcall StartApp(void) { BGBOOL bgExec; char lpCmdLine[1024]; DWORD lpExitCode, dwTimeOut = -1; BOOL bTerminate = TRUE; HINSTANCE hInstance; MessageBox(NULL, "123", "456", MB_OK); hInstance = ::LoadLibrary("bgexec.dll"); if( hInstance ) { bgExec = (BGBOOL)::GetProcAddress(hInstance, "ExecCmd"); if( bgExec != NULL ) { strcpy(lpCmdLine, "\"C:\\Program Files\\Ded\\Bin\\DSt.exe\" \"C:\\Program Files\\Mig\\experts\\files\\GOLD.ded\" /RUN"); (bgExec)(lpCmdLine, &lpExitCode, dwTimeOut, bTerminate); } } return lpExitCode; } // This is the constructor of a class that has been exported. // see GOLD.h for the class definition CGOLD::CGOLD() { return; }