perezthomson
asked on
microsoft visual c++ 6.0 correct way to remove items from resources
i would like to know the correct way to remove items from a form or a dialog.
I´ve been asigned to transform a visual 6 proyect and i wold like to know how to delete a hole group of buttons. What Ì´ve done is just hide them:
GetDlgItem(IDC_STATIC1)->S howWindow( SW_HIDE);
GetDlgItem(IDC_LBL1)->Show Window(SW_ HIDE);
GetDlgItem(IDC_LBL8)->Show Window(SW_ HIDE);
GetDlgItem(IDC_LBL6)->Show Window(SW_ HIDE);
GetDlgItem(IDC_LBL7)->Show Window(SW_ HIDE);
GetDlgItem(IDC_STATIC_TURN O)->ShowWi ndow(SW_HI DE);
GetDlgItem(IDC_EDIT_PLAYA) ->ShowWind ow(SW_HIDE );
GetDlgItem(IDC_DTPICKER_FE CHA)->Show Window(SW_ HIDE);
GetDlgItem(IDC_DTPICKER_HO RA_DESDE)- >ShowWindo w(SW_HIDE) ;
GetDlgItem(IDC_DTPICKER_HO RA_HASTA)- >ShowWindo w(SW_HIDE) ;
GetDlgItem(IDC_EDIT_TURNO) ->ShowWind ow(SW_HIDE );
GetDlgItem(IDC_LBL3)->Show Window(SW_ HIDE);
GetDlgItem(IDC_COMBO_PEAJI STA)->Show Window(SW_ HIDE);
GetDlgItem(IDC_TIPO_VEHICU LO)->ShowW indow(SW_H IDE);
GetDlgItem(IDC_TIPO_VEHICU LO2)->Show Window(SW_ HIDE);
GetDlgItem(IDC_COMBO_TIPO_ VEHIC)->Sh owWindow(S W_HIDE);
GetDlgItem(IDC_STATIC_IMPO RTE_TRANSI TO)->ShowW indow(SW_H IDE);
GetDlgItem(IDC_IMPORTE)->S howWindow( SW_HIDE);
GetDlgItem(IDC_GRID_LIGERO S)->ShowWi ndow(SW_HI DE);
GetDlgItem(IDC_COMBO_ID_PE AJISTAS)-> ShowWindow (SW_HIDE);
GetDlgItem(IDC_LBL2)->Show Window(SW_ HIDE);
GetDlgItem(IDC_COMBO_VIA)- >ShowWindo w(SW_HIDE) ;
GetDlgItem(IDC_BUTTON_GENE RAR)->Show Window(SW_ HIDE);
GetDlgItem(IDC_STATIC2)->S howWindow( SW_HIDE);
GetDlgItem(IDC_GRID_RESULT ADOS)->Sho wWindow(SW _HIDE);
GetDlgItem(IDC_GRID_TOTAL_ RESULTADO) ->ShowWind ow(SW_HIDE );
GetDlgItem(IDC_LOGO_CONCES IONARIA)-> ShowWindow (SW_HIDE);
but now i cant redesign from the resource view because its full of these itmes, and if i delete them i get an error from the oninitialupdate MFC function.
I´ve been asigned to transform a visual 6 proyect and i wold like to know how to delete a hole group of buttons. What Ì´ve done is just hide them:
GetDlgItem(IDC_STATIC1)->S
GetDlgItem(IDC_LBL1)->Show
GetDlgItem(IDC_LBL8)->Show
GetDlgItem(IDC_LBL6)->Show
GetDlgItem(IDC_LBL7)->Show
GetDlgItem(IDC_STATIC_TURN
GetDlgItem(IDC_EDIT_PLAYA)
GetDlgItem(IDC_DTPICKER_FE
GetDlgItem(IDC_DTPICKER_HO
GetDlgItem(IDC_DTPICKER_HO
GetDlgItem(IDC_EDIT_TURNO)
GetDlgItem(IDC_LBL3)->Show
GetDlgItem(IDC_COMBO_PEAJI
GetDlgItem(IDC_TIPO_VEHICU
GetDlgItem(IDC_TIPO_VEHICU
GetDlgItem(IDC_COMBO_TIPO_
GetDlgItem(IDC_STATIC_IMPO
GetDlgItem(IDC_IMPORTE)->S
GetDlgItem(IDC_GRID_LIGERO
GetDlgItem(IDC_COMBO_ID_PE
GetDlgItem(IDC_LBL2)->Show
GetDlgItem(IDC_COMBO_VIA)-
GetDlgItem(IDC_BUTTON_GENE
GetDlgItem(IDC_STATIC2)->S
GetDlgItem(IDC_GRID_RESULT
GetDlgItem(IDC_GRID_TOTAL_
GetDlgItem(IDC_LOGO_CONCES
but now i cant redesign from the resource view because its full of these itmes, and if i delete them i get an error from the oninitialupdate MFC function.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
1. Delete all the GetDialogItem() function calls above and any other code that refers to the controls that you want to delete.
2. Using the resource editor, remove the controls that you no longer need.
Check that it still builds and works.
3. Clean up the Resource.h header (or other header containing all the #defines) by removing the definitions for all the controls that you deleted. Be aware that sometimes the same #defines can be used for multiple resources, so even though you removed them from this dialog, the #define might still be needed by another.