Solved

data sharing in Visual C++ 5.0

Posted on 1998-08-12
8
206 Views
Last Modified: 2013-11-20
I have several dialog boxes in my project and I need to take amounts from one
   screen to another, will someone please tell me how to share the data between
   them.  I have already create variables for the edit boxes which I am trying to share
   data between.  The data I am trying to get is in CService2Dialog and I am trying
   to place it in CServiceDialog. Please tell me how to do this they easiest way.
   Thank You for the much need help!
0
Comment
Question by:troy24
8 Comments
 
LVL 7

Expert Comment

by:psdavis
ID: 1320653
Troy, delete this question.
0
 
LVL 1

Expert Comment

by:Musashi
ID: 1320654
If a 50 point question is considered easy, a 5 point question is probably so absurdly trivial that you know the answer the moment you ask it. So troy24, why do you think so many people insist on posting 5 point questions?  Perhaps experts should show a little personal pride and shun such questions, or are we so addicted to providing answers that we have no standards?  I'm not sure that I can think of a valid 5 point question; maybe "How do you correctly spel Mikrosofd?"

Troy24, the answer to your question IS Easy, however it IS NOT absurdly trivial.
0
 
LVL 6

Expert Comment

by:thresher_shark
ID: 1320655
To share data between dialog boxes, you have to...

-------
You post 5 point question, we post 5 point responses :-)
0
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 7

Expert Comment

by:psdavis
ID: 1320656
p.s.  Your points aren't limited.  You can BUY more points. That's how experts-exchange stays in business.

0
 

Accepted Solution

by:
bogie2 earned 20 total points
ID: 1320657
This should work:

CService2Dialog dlg2;
CServiceDialog dlg;
dlg2.DoModal();
dlg.m_myvar = dlg2.m_myvar;
dlg.UpdateData();
dlg.DoModal();

0
 
LVL 7

Expert Comment

by:psdavis
ID: 1320658
Bogie!!! Quit that... He's asked the question already.

However... ;) Your code won't work either.  You're creating two modal dialog boxes in your example.  The first one has to finish before the second DoModal will execute.

Phillip
0
 

Author Comment

by:troy24
ID: 1320659
Adjusted points to 25
0
 
LVL 7

Expert Comment

by:psdavis
ID: 1320660
Bogie, You know, depending on exactly what he's trying to do, it just might work anyway.  If all he's trying to do is take data collected from the first dialog and close that first dialog and then open up the second dialog and transfer the data to it, then you are absolutely correct and have given the best answer.

Sorry for the previous comment.

Phillip
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
function returning CString in a regular win32 DLL 8 189
Shell script to login to remote m/c and execute commands 10 78
noX challenge 17 129
Path of Workbook 3 86
Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question