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
Solved

Classes Interact

Posted on 2004-09-10
3
192 Views
Last Modified: 2013-11-20
Suppose that I have a COleControl that open a CDialog, how can I do to interact with the parent class?? Via messages??

Thanks.
0
Comment
Question by:DAE
3 Comments
 
LVL 13

Accepted Solution

by:
SteH earned 125 total points
ID: 12024436
Messages would be the cleanest solution.

In principle you can call GetParent () to get a CWnd* pointer of the parent class. But most likely you won't be able to use this without casting it to the actual type of the parent. That way the dialog class needs to know all details about the parent class which should be avoided for OO design.

With messages you only need to know the message number and what to specify as parameter. The parent class will handle them accordingly. You still need a pointer of the parent class but this time the CWnd* is sufficient.
0
 
LVL 44

Expert Comment

by:AndyAinscow
ID: 12024448
Your question is very general but the answer is likely to be yes.

Messages are a general way of communicating without relying on knowing anything else about the windows involved.
If you are worried about using a message that is already in use then look at RegisterWindowsMessage in help.  This gives a unique message for an identifier, other windows will get the same ID for the same identifier.
0
 

Author Comment

by:DAE
ID: 12037218
Thaks SteH and Andy
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

Preface In the first article: A Better Website Login System (http://www.experts-exchange.com/A_2902.html) I introduced the EE Collaborative Login System and its intended purpose. In this article I will discuss some of the design consideratio…
Preface This is the third article about the EE Collaborative Login Project. A Better Website Login System (http://www.experts-exchange.com/A_2902.html) introduces the Login System and shows how to implement a login page. The EE Collaborative Logi…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

791 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