Event handling
-
Hey guys, I don't know how to handle the events in Visual C++ . NET There seem to be no Class Wizard as it used to be in VS6 My problem is I need to handle certain events from certain classes. Primarily I need to execute a portion of code (function) when the CSocket class (or CAsynSocket class) detects an event OnConnect(), notifying my MFC application about a client trying to connect to this server. The class CAsynSocket has this function (onConnect), I just don't know how to use it. Even something simpler like executing a function when the key is pressed or the mouse is moved. Even that would help. Any event handling sugesstions would be greatelly appreciated. Thanks. Best regards, Andrew
-
Hey guys, I don't know how to handle the events in Visual C++ . NET There seem to be no Class Wizard as it used to be in VS6 My problem is I need to handle certain events from certain classes. Primarily I need to execute a portion of code (function) when the CSocket class (or CAsynSocket class) detects an event OnConnect(), notifying my MFC application about a client trying to connect to this server. The class CAsynSocket has this function (onConnect), I just don't know how to use it. Even something simpler like executing a function when the key is pressed or the mouse is moved. Even that would help. Any event handling sugesstions would be greatelly appreciated. Thanks. Best regards, Andrew
Hi Andrew, I do this by using the Properties Window (under the View menu). Choose the .h or .cpp file of a class then open the Properties Window, there are 3 buttons which allow you to see Events, Messages and Overrides for that class. Hope that helps, Rob
-
Hi Andrew, I do this by using the Properties Window (under the View menu). Choose the .h or .cpp file of a class then open the Properties Window, there are 3 buttons which allow you to see Events, Messages and Overrides for that class. Hope that helps, Rob
Thanks a lot. It helped me to get started. Now I can handle any messages of the classes that are included in my project. Now I need to find out how to handle a message that is not included in my project (just some class from the library) in my case it is CSockets. I should be able to get it. Thanks again. Best regards, Andrew