Exemplo n.º 1
0
int
InvokeLoadAndRunGucefPlatformApp( const char* appName ,
                                  const char* rootDir ,
                                  int platformArgc    ,
                                  char** platformArgv ,
                                  int appArgc         ,
                                  char** appArgv      )
{
    char* modulePath = GetLibPath( rootDir, "libgucefLOADER.so" );
    void* modulePtr = (void*) dlopen( modulePath, RTLD_NOW );
    if ( NULL == modulePtr )
    {
        free( modulePath );
        LOGF( "Unable to link gucefLOADER module" );
        return 0;
    }
    FLOGI( "Loading loader module from: %s", modulePath );
    free( modulePath );
    modulePath = NULL;

    TGUCEFCORECINTERFACE_LoadAndRunGucefPlatformApp loadAndRunGucefPlatformApp =
        (TGUCEFCORECINTERFACE_LoadAndRunGucefPlatformApp) dlsym( modulePtr, "LoadAndRunGucefPlatformApp" );

    if ( NULL == loadAndRunGucefPlatformApp )
    {
        LOGF( "Unable to link gucefLOADER function: LoadAndRunGucefPlatformApp" );
        dlclose( modulePtr );
        return 0;
    }

    char* libRootDir = GetAssetLibRoot( rootDir );
    char* assetRootDir = GetAssetPath( rootDir, "" );

    int returnValue = loadAndRunGucefPlatformApp( appName      ,
                                                  rootDir      ,
                                                  assetRootDir ,
                                                  libRootDir   ,
                                                  platformArgc ,
                                                  platformArgv ,
                                                  appArgc      ,
                                                  appArgv      );

    free( libRootDir );
    libRootDir = NULL;
    free( assetRootDir );
    assetRootDir = NULL;
    dlclose( modulePtr );
    modulePtr = NULL;

    FLOGI( "LoadAndRunGucefPlatformApp returned with code %i", returnValue );
    return returnValue;
}
Exemplo n.º 2
0
MRESULT EXPENTRY DetailsDllWndProc (HWND hDlg, USHORT Msg, MPARAM mp1, MPARAM mp2)

{
static PSHORT pDetailEntry;
CHAR   TitleStr[41];


switch (Msg)
  {
  case WM_INITDLG:
       pDetailEntry = PVOIDFROMMP (mp2);

       strcpy (TitleStr, "Details ");
       strcat (TitleStr, pShowTableData[*pDetailEntry].Name);
       WinSetWindowText (hDlg, TitleStr);


       /*--- get current libpath --*/

       if (!GetLibPath (Libpath, MAX_LIBPATH_SIZE, ErrorStr))
         {
         WinMessageBox (HWND_DESKTOP, hWndFrame, ErrorStr,
		        ApplTitle, 0, MB_OK | MB_ICONEXCLAMATION | MB_APPLMODAL);
         WinDismissDlg (hDlg, FALSE);
         break;
         }


       /*--- fill exported procedures ---*/

       if (!_FillExportedProcedures (hDlg, *pDetailEntry, ErrorStr))
         {
         WinMessageBox (HWND_DESKTOP, hWndFrame, ErrorStr,
		        ApplTitle, 0, MB_OK | MB_ICONEXCLAMATION | MB_APPLMODAL);
         WinDismissDlg (hDlg, FALSE);
         break;
         }


       /*--- fill imported modules ---*/

       if (!_FillImportedModules (hDlg, *pDetailEntry, ErrorStr))
         {
         WinMessageBox (HWND_DESKTOP, hWndFrame, ErrorStr,
		        ApplTitle, 0, MB_OK | MB_ICONEXCLAMATION | MB_APPLMODAL);
         WinDismissDlg (hDlg, FALSE);
         break;
         }


       CenterDialog (HWND_DESKTOP, hDlg);

       WinSetFocus (HWND_DESKTOP, WinWindowFromID (hDlg, LID_DETAILS_DLL_EXP_RES));
       return ((MRESULT) TRUE);


  case WM_COMMAND:
        switch (SHORT1FROMMP(mp1))
	 {
	 case DID_CANCEL:
	      WinDismissDlg (hDlg, FALSE);
	      break;
	 }
       break;


  default:
       return WinDefDlgProc (hDlg, Msg, mp1, mp2);
  }


return NULL;
}