00001
00002
00003
00004 #include <Windows.h>
00005 #include "../../../../../../libs/DetectFramework2/DetectFramework.h"
00006 #include "../../../../../../libs/GetWindowsVersion/GetWindowsVersion.h"
00007
00008 typedef int (*MYPROC) (HINSTANCE, HINSTANCE ,LPSTR szCmdLine, int iCmdShow);
00009
00010 int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance,LPSTR szCmdLine, int iCmdShow)
00011 {
00012 HINSTANCE hinstLib;
00013 MYPROC Windows_Main;
00014 BOOL fFreeResult, fRunTimeLinkSuccess = FALSE;
00015
00016 if (!DetectFrameWorkNET2())
00017 {
00018 MessageBox(NULL,"The .NET Framework 2.0 is not installed","Warning",MB_ICONWARNING);
00019 return -1;
00020 }
00021
00022 if (GetWindowsVersion()<OS_WIN32_WINDOWS_2000)
00023 {
00024 MessageBox(NULL,"Scilab requires Windows 2000 or more.","Warning",MB_ICONWARNING);
00025 return -1;
00026 }
00027
00028 hinstLib = LoadLibrary(TEXT("Libscilab"));
00029 if (hinstLib != NULL)
00030 {
00031 Windows_Main = (MYPROC) GetProcAddress(hinstLib, TEXT("Windows_Main"));
00032
00033 if (NULL != Windows_Main)
00034 {
00035 fRunTimeLinkSuccess = TRUE;
00036 (Windows_Main)(hInstance,hPrevInstance,szCmdLine, iCmdShow);
00037 }
00038 fFreeResult = FreeLibrary(hinstLib);
00039 }
00040
00041 if (! fRunTimeLinkSuccess)
00042 {
00043 MessageBox(NULL,"Wscilex.exe : Libscilab.dll not found !","Warning",MB_ICONERROR);
00044 exit(1);
00045 }
00046 else exit(0);
00047
00048 return 0;
00049 }
00050