LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices



Reply
 
Search this Thread
Old 11-07-2007, 11:59 PM   #1
chrisliando
LQ Newbie
 
Registered: Nov 2007
Posts: 8

Rep: Reputation: 0
Fire Event from other event in Visual C++ Express Edition


Hi I was trying to fire an event from another event (I just want if I click the button it also raise the FormClosing event) in my codes below:



private: System::Void FormInputPersonal_FormClosing(System::Object^ sender, System::Windows::Forms::FormClosingEventArgs^ e) {
e->CloseReason;
}



private: System::Void button2_Click(System::Object^ sender, System::EventArgs^ e) {
//close Form.
this->button2->Click += gcnew System::EventHandler(this, &FormInputPersonal->FormClosingEventHandler);
}



but I had trouble on the event Button2 Click which generated errors:



------ Build started: Project: Assignment1, Configuration: Debug Win32 ------
Compiling...
FormInputPersonal.cpp
c:\chris\testing\assignment1\assignment1\FormInputPersonal.h(449) : error C2819: type 'Assignment1::FormInputPersonal' does not have an overloaded member 'operator ->'
c:\chris\testing\assignment1\assignment1\FormInputPersonal.h(24) : see declaration of 'Assignment1::FormInputPersonal'
did you intend to use '.' instead?
c:\chris\testing\assignment1\assignment1\FormInputPersonal.h(449) : error C2039: 'FormClosingEventHandler' : is not a member of 'Assignment1::FormInputPersonal'
c:\chris\testing\assignment1\assignment1\FormInputPersonal.h(24) : see declaration of 'Assignment1::FormInputPersonal'
c:\chris\testing\assignment1\assignment1\FormInputPersonal.h(449) : error C3350: 'System::EventHandler' : a delegate constructor expects 2 argument(s)
Assignment1.cpp
c:\chris\testing\assignment1\assignment1\FormInputPersonal.h(449) : error C2819: type 'Assignment1::FormInputPersonal' does not have an overloaded member 'operator ->'
c:\chris\testing\assignment1\assignment1\FormInputPersonal.h(24) : see declaration of 'Assignment1::FormInputPersonal'
did you intend to use '.' instead?
c:\chris\testing\assignment1\assignment1\FormInputPersonal.h(449) : error C2039: 'FormClosingEventHandler' : is not a member of 'Assignment1::FormInputPersonal'
c:\chris\testing\assignment1\assignment1\FormInputPersonal.h(24) : see declaration of 'Assignment1::FormInputPersonal'
c:\chris\testing\assignment1\assignment1\FormInputPersonal.h(449) : error C3350: 'System::EventHandler' : a delegate constructor expects 2 argument(s)
Generating Code...
Build log was saved at "file://c:\Chris\Testing\Assignment1\Assignment1\Debug\BuildLog.htm"
Assignment1 - 6 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========


Please help me with this problem.



Thank you very much..
 
Old 11-08-2007, 06:12 PM   #2
matthewg42
Senior Member
 
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530

Rep: Reputation: 63
I realise this sub-forum is about programming in general, but this site is Linux Forums, not Windows Forums.

I'm sure that if anyone here knows about Microsoft's development platform, they will be happy to discuss it (as would I if I knew enough about it). However you're much more likely to find Linux and Unix coders here, and not so many coders who use Visual C++.

I say this not to discourage discussion of MS products, but because I don't want you to feel like your questions are being ignored... it's just that you're asking people who for the most part don't use the product you are asking about.

One more thing - please post code, compiler output and data examples enclosed in [code] tags. This will cause that part of your post to be printed in a fixed width font, and will preserve formatting, aiding readability.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Visual C++ form creation event? chrisliando Programming 3 11-07-2007 02:22 AM
Script on event ronerazo Linux - Newbie 1 10-21-2007 03:26 AM
Event Capturing rem1986 Linux - General 2 12-13-2005 01:11 PM
Event logging RajaRC Linux - Networking 2 10-28-2004 01:59 AM
how to fire mouse event using 'C' code karthikeyan Linux - Software 2 03-08-2003 12:35 PM


All times are GMT -5. The time now is 10:58 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration