Jump to content
  • Advertisement
Sign in to follow this  
geekalert

Subclassing?

This topic is 4500 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

How would I modify the Win32 "EDIT" class so that it can highlight certain sections of XML? (I am making a small XML editor, plz dont ask why) I've heard subclassing involves MFC - how can I not use MFC (Win32 API only!)? Thanks in advance.

Share this post


Link to post
Share on other sites
Advertisement
I think you're confusing a few different ideas here.

To create your own edit control that does XML syntax highlighting does not require "subclassing" or any form of inheritance; inheritance is just an easy way to get that accomplished. For instance, you can have your own class inherit from the MFC class for an edit control, and then you can simply override the display functions to perform the syntax highlighting.

If you want to stick strictly with the Win32 API, you should keep in mind that you're working with a C based library, which makes things like this more difficult, to the extent that I wouldn't consider it worth the attempt, considering how much code you'd most likely have to reinvent. In all honesty I recommend you find another library built on top of the Win32 API that's more useful for this sort of thing. MFC helps, but there are other options if you're opposed to using it. Recently most of my GUI code has been done using GTK for instance.

Share this post


Link to post
Share on other sites
To save yourself some time, you might want to look into to using Scintilla for your editor. It is a well tested and powerful control. Applications like Notepad++ use it.

If you'd like to learn about subclassing anyway then you should take a look at subclassing as presented by the MSDN. Some of the tutorials at Catch-22 make use of subclassing. I encourage you to take a look at the custom control tutorials.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!