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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

graphic shape as an object

Status
Not open for further replies.

azamK

Programmer
Aug 12, 2001
10
IR
Hello
I want to have a graphic shape -such as line- as an object that this object have events and properties.
How can I do in vc++?

thanks
azam keypour
 
What kind of events are you talking about?
You can define your own events in VC and make the object send messages according to the type of event you need. But you can also use the existing mechanisms (e.g. for drag and drop).
 
thanks alexboly.
but How can I do it?
events such as click,dbclick and etc.
for graphical shapes in a DC.

thanks.
 
I think that the best way to do it is to derive a class from CCmdTarget. I would make this class a base class for all shapes.
You have to override the functionality of OnCmdMsg and call specific message handlers for each event you want treated.
You will find more details in the MSDN, at CCmdTarget.
I think that there is a sample in VC similar to what you want.
Anyway, the discussion above is valid only if you use Visual C++ 6.0. If you use Visual C++ .NET, things are much simpler.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top