Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C++ and Visual C++ > Visual C++
| Search | Today's Posts | Mark Forums Read
Visual C++ Questions specific to Microsoft's Visual C++. For questions not specific to this Microsoft version, use the C++ Programming forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Visual C++ section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 30th, 2009, 01:03 PM
Registered User
 
Join Date: Sep 2009
Location: Medina, Ohio
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Question Passing an event from a class to the class that created it?

New to using MS Visual C++ 2008 Express edition.

In my program, my main Form (Form1) creates a secondary Form (Form2) as a Modeless dialog. I do not want to use Modal dialog for Form2. My problem is how do I let Form1 know when Form2 is closed?
 
Old October 1st, 2009, 01:25 PM
Registered User
 
Join Date: Sep 2009
Location: Medina, Ohio
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Talking Figured it out.

Thanks anyway.
 
Old October 6th, 2009, 03:00 AM
Registered User
 
Join Date: Oct 2009
Posts: 3
Thanks: 0
Thanked 1 Time in 1 Post
Default

have created a standard .EXE that dynamically loads controls at runtime. The controls are either labels, text boxes, picture frames, and options buttons. The program is a survey that, depending on the number of questions loaded from a database, the appropriate amount of controls for each question need to be loaded. The program works like a champ right now.

However, now I'm trying to 'clean up' the code and break up redundant code into class modules with methods that can be called. I find that the class modules don't seem to 'recognize' the initial controls on the form. I have figured out that you somehow need to pass controls (or the entire form) through parameters, and I've tried this. However, it still doesn't seem to work. I have also made sure I declared a new class variable inside the form.
 
Old October 6th, 2009, 11:14 AM
Registered User
 
Join Date: Sep 2009
Location: Medina, Ohio
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Unhappy Not much help

I don't think I can be of much help. The way I fixed my problem was with templates and allowing events to pass up to the calling class, and it is still not perfect. If this helps, good. If not, hopefully someone else will answer you.




Similar Threads
Thread Thread Starter Forum Replies Last Post
Passing JPanel to Another Class Gui d-mart Java GUI 1 June 25th, 2009 05:58 AM
Passing JPanel to Another Class d-mart Java Basics 1 May 29th, 2009 05:50 AM
creating an event for a custom class? lkubler BOOK: Beginning Access 2003 VBA 3 September 20th, 2005 03:47 PM
Passing Class object to WS r_ganesh76 .NET Web Services 4 October 4th, 2004 11:12 PM
Passing a class by reference James Diamond VB How-To 13 February 16th, 2004 06:07 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.