Jump to content
  • Advertisement
Sign in to follow this  
SuperFlanker

Windows Rich Edito Control and Tree control

This topic is 3903 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

I am working on providing a basic interface for my game engine. The tree control is to store the scene-graph. The rich edit is for my script interface. I am not using MFC. The problem is when I add these objects from the toolbox to my dialog, my dialog will not appear. I read that I need to do something like LoadLibrary() on the rich edit to register WNDCLASS. Does anyone know what I need to do for the tree control?

Share this post


Link to post
Share on other sites
Advertisement
Whenever I see Win32 being used for anything more then a window frame these days I have to think there are easier ways. I know MFC isnt available in all versions of visual studio, but have you ever thought of building your window using .NET? It will get these things up and running much faster. You can still use unmanaged code (Im assuming C++?).

Share this post


Link to post
Share on other sites
Quote:
Original post by NumberXaero
Whenever I see Win32 being used for anything more then a window frame these days I have to think there are easier ways. I know MFC isnt available in all versions of visual studio, but have you ever thought of building your window using .NET? It will get these things up and running much faster. You can still use unmanaged code (Im assuming C++?).


IMO using .NET or MFC just to set up two controls in a dialog is like using nukes to swat at flies. Of course if the OP here is creating a full-fledged GUI app I'd say go for it, but sometimes you just want to add some Windows GUI stuff to the actual game. For example, in the game I'm working on now I added a developer console that's a dialog with a Tree-View, a combo box, and a few edit controls. In that case I didn't want to drag in the MFC dll and re-write my bare-bones window-handling code, nor did I want to make my user sit through a .NET 3.5 installation. So, I used the plain old Win32 functions and messages and got it working very quickly.

Share this post


Link to post
Share on other sites
In my experience Ive found that early on these little helper/utility apps start out with a few controls, but I start needing it to do more as time goes on, and before I know it Im up to my eyes in Win32 code. Which is why I suggested starting with something quick and manageable so you dont end up regretting it later.
As for .NET, IMO it shouldnt be considered an extra step, as its becoming more and more a part of windows. Its ease of use shouldnt be given a second thought because the way I see it, it really just boils down to a windows update, and Ive encountered many programs that already require it.

Share this post


Link to post
Share on other sites
As mutex mentioned, try to load the common control library before creating a window. The class name of TreeView is ICC_TREEVIEW_CLASSES.;

#include <commctrl.h> // common controls
...
// register TreeView from comctl32.dll before creating windows
INITCOMMONCONTROLSEX commonCtrls;
commonCtrls.dwSize = sizeof(commonCtrls);
commonCtrls.dwICC = ICC_TREEVIEW_CLASSES; // TreeView class name
InitCommonControlsEx(&commonCtrls);




The following link describes how to create/use a treeview control without using MFC. The example program contains a treeview control inside a dialog window.
TreeView Control

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!