WdeResInfo *WdeLoadResource( const char *file_name ) { WdeResInfo *res_info; WRFileType file_type; bool ok; WdeSetWaitCursor( TRUE ); ok = ((res_info = WdeAllocResInfo()) != NULL); if( ok ) { file_type = WRIdentifyFile( file_name ); ok = (file_type != WR_INVALID_FILE); } if( ok ) { res_info->info = WRLoadResource( file_name, file_type ); ok = (res_info->info != NULL); } if( ok ) { res_info->dlg_entry = WdeFindTypeNode( res_info->info->dir, RESOURCE2INT( RT_DIALOG ), "DIALOG" ); } if( !ok ) { if( res_info != NULL ) { WdeFreeResInfo( res_info ); res_info = NULL; } } WdeSetWaitCursor( FALSE ); return( res_info ); }
WdeResInfo *WdeCreateNewResource( char *title ) { WdeResInfo *res_info; bool ok; ok = ((res_info = WdeAllocResInfo()) != NULL); if( ok ) { ok = ((res_info->info = WRAllocWRInfo()) != NULL); } if( ok ) { res_info->hash_table = WRInitHashTable(); ok = (res_info->hash_table != NULL); } if( ok ) { if( title != NULL ) { res_info->info->save_name = WdeStrDup( title ); ok = (res_info->info->save_name != NULL); } } if( ok ) { #ifdef __NT__ res_info->is32bit = TRUE; #else res_info->is32bit = FALSE; #endif ok = WdeCreateResourceWindow( res_info, 0, title ); } if( ok ) { ListAddElt( &WdeResList, (void *)res_info ); if( !WdeIsDDE() || title == NULL ) { ok = (WdeCreateNewDialog( NULL, res_info->is32bit ) != NULL); } } if( ok ) { WdeCheckBaseScrollbars( FALSE ); } if( res_info ) { if( ok ) { WdeSetResModified( res_info, FALSE ); } else { WdeRemoveResource( res_info ); res_info = NULL; } } return( res_info ); }