Solved

data sharing in Visual C++ 5.0

Posted on 1998-08-12
8
209 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Get proactive database performance tuning online

At Percona’s web store you can order full Percona Database Performance Audit in minutes. Find out the health of your database, and how to improve it. Pay online with a credit card. Improve your database performance now!

 
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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
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…
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.
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
Suggested Courses

636 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