Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > C# and C > C++ and Visual C++ > Visual C++
Password Reminder
Register
| FAQ | Members List | Calendar | 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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
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?
Reply With Quote
  #2 (permalink)  
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.
Reply With Quote
  #3 (permalink)  
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.
Reply With Quote
  #4 (permalink)  
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.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 02:15 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.