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 ); }
WREResInfo *WRECreateNewResource( char *filename ) { WREResInfo *res_info; Bool ok; ok = ((res_info = WREAllocResInfo()) != NULL); if( ok ) { res_info->info = WRAllocWRInfo(); ok = (res_info->info != NULL); } if( ok ) { res_info->symbol_table = WRInitHashTable(); ok = (res_info->symbol_table != NULL); } if( ok && filename != NULL ) { res_info->info->save_name = WREStrDup( filename ); ok = (res_info->info->save_name != NULL); } if( ok ) { #ifdef __NT__ res_info->is32bit = TRUE; #else res_info->is32bit = FALSE; #endif if( res_info->is32bit ) { res_info->info->internal_type = WR_WINNTW_RES; } else { res_info->info->internal_type = WR_WIN16W_RES; } WREFindAndLoadSymbols( res_info ); ok = WRECreateResourceWindow( res_info ); } if( res_info != NULL ) { if( ok ) { ListAddElt( &WREResList, (void *)res_info ); } else { WREFreeResInfo( res_info ); res_info = NULL; } } return( res_info ); }