Dialog base application
-
Hi, I have one dialog base application. It contains list control having some data in report view. After double clicking on it a new modeless dialog gets opened. It contains edit controls which contains data of list control's selected row. If i edit data in edit controls and press OK then data in list control should get updated with newly updated data. My problem is how I pass updated data to list control of parent dialog. I am using Microsoft Visual studio 6.0. Regards Nikesh
-
Hi, I have one dialog base application. It contains list control having some data in report view. After double clicking on it a new modeless dialog gets opened. It contains edit controls which contains data of list control's selected row. If i edit data in edit controls and press OK then data in list control should get updated with newly updated data. My problem is how I pass updated data to list control of parent dialog. I am using Microsoft Visual studio 6.0. Regards Nikesh
Implement an appropriate method in the parent dialog (the parent dialog, upon creation of the child one, should pass to the child a pointer to itself). See this CodeProject's article:"Dialogs Communication"[^]. :)
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
[My articles] -
Hi, I have one dialog base application. It contains list control having some data in report view. After double clicking on it a new modeless dialog gets opened. It contains edit controls which contains data of list control's selected row. If i edit data in edit controls and press OK then data in list control should get updated with newly updated data. My problem is how I pass updated data to list control of parent dialog. I am using Microsoft Visual studio 6.0. Regards Nikesh
When creating the modeless dialog, you have to specify a HWND that owns the new dialog; enter the HWND of the dialog containing the list control here. You can use the GetParent[^] function to get the parent window HWND when the OK button is clicked on your modeless dialog. Use GetDlgItem[^] to get the HWND of the list view. Now you can use SendMessage[^] with LVM_INSERTITEM[^] or LVM_SETITEM[^] to add/edit data in your list control.