![]() |
|
#1
|
|||
|
|||
getting data from dialog before closeHi, I apologize for this lamer question, but I can't still resolve this problem:
I open a dialog to get some information from user (few edit controls). When user cliks "ok" I want to get these information in parent window? How can I pass these information? (and when? before closing dialog and after it is clicked to "ok" ?) |
|
#2
|
||||
|
||||
Re: getting data from dialog before closeSee the help for the UpdateData() function for more information, but basically when the user clicks 'OK', this is the function that transfers data from the dialog box to the data members that are tied to the dialog's controls. Then you should be able to use those variables as needed.
__________________
Use the force...read the source!! WYCIWYG -- what you code is what you get! |
|
#3
|
|||
|
|||
Re: getting data from dialog before closeUpdateData() set values of local vars
but I need to set values of vars in parent window. is this possible with UpdateData() as well? |
|
#4
|
|||
|
|||
Re: getting data from dialog before closeOne method that works for me is to send into the dialog a pointer to a structure declared in the parent. Then when the dialog closes (say use OnDestroy), write the values into that structure. They will then be available to the parent after the dialog has gone.
so: 1. create a public method that will take a pointer to a structure as its argument. 2. declare the structure in the parent before starting the dialog 3. After decalring the dialog, and before using DoModal(), call this new function and pass the address of the structure 4. in the OnDestroy function write the values back to the parent using the structure pointer. Hope this helps |
|
#5
|
|||
|
|||
Re: getting data from dialog before closeyeah, I has already thought about something like that. thx
|
|
#6
|
|||
|
|||
Re: getting data from dialog before closeNow I discovered a better way how to get info. When "DoModal" returns value, the dialog is still "alive" and so you can access its control edits etc...
Code:
|
|
#7
|
|||
|
|||
Re: getting data from dialog before closeLooks a very reasonable way to do it. I think you have solved this problem now.
Regards |
Recent GIDBlog
US Elections and the ?Voter?s Responsibility? by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| [Include] Doubly-linked List | dsmith | C Programming Language | 6 | 14-Apr-2006 14:12 |
| Strange C++ code memory leakage problem | gaoanyu | C++ Forum | 7 | 04-Nov-2005 09:09 |
| Help! Some basal questions about MFC | xutingnjupt | MS Visual C++ / MFC Forum | 1 | 05-Dec-2004 04:38 |
| [CONTEST?]Data Structure Test | dsmith | C Programming Language | 2 | 06-Jun-2004 16:13 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The