Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

data sharing in Visual C++ 5.0

Posted on 1998-08-12
8
Medium Priority
?
213 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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 60 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
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.
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses

971 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