Solved

data sharing in Visual C++ 5.0

Posted on 1998-08-12
8
202 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
 
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
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 

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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Suggested Solutions

Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
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.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

705 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now