Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Vis Studio 2003

Status
Not open for further replies.

Kalisto

Programmer
Joined
Feb 18, 2003
Messages
997
Location
GB
OK, I just got this (last Vis studio was V6)

2 Questions, one MFC and one VS

1)How do I add Windows Messages now, do I get to edit the Message block myself, as I can't see a screen for adding them

2) I want to Use MessageBox() in a class I have created to display exceptions, but it doesn't have the HWND of the view class.

I vaguely remember needing to create a MyView pointer, and dynamic_cast it. And then I can get hwnd from the View. Is this correct (and what is the genuine syntax), or is there a better way of displaying a message popup with my exceptions in ?



 
Kalisto,

#1 Select the class in the "Class View". Then open the "Properties View" (from the menu is one way). Now at the top of the Properties View there is a toolbar with several buttons depending on the class. For MFC CWnd classes you will find a button for "Messages" and another for "Overrides" etc. That should get you going. Let me know if you need more specific help with that.

#2 Use AfxMessageBox(...)

-pete
 
Cheers Pete, That'll kick start me anyway.
It looks like I cna see the list of messages already configured, so I guess if I need to add new ones in, I just do it by hand.

Thanks again,

K
 
>> so I guess if I need to add new ones in, I just do it by hand.

You always had to add user messages by hand. Or are you referring to something else?

-pete
 
I was thinking of WM_ messages, iirc, in V6 you could add messages for a window to handle.

 
>> in V6 you could add messages for a window to handle.

If you created a user message:
Code:
#define WM_MYMESSAGE WM_USER + 11

You had to implement the message handlers by hand. Class Wizard in VC6 did not support user message handler creation. They still have to be done by hand in VC7.

-pete
 
OK, thanks. It was me getting confused :-/

K
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top