# Windows Rich Edito Control and Tree control

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

## 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 on other sites
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 on other sites
Quote:
 Original post by NumberXaeroWhenever 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 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 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 windowsINITCOMMONCONTROLSEX commonCtrls;commonCtrls.dwSize = sizeof(commonCtrls);commonCtrls.dwICC = ICC_TREEVIEW_CLASSES;   // TreeView class nameInitCommonControlsEx(&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 on other sites

No, the real link is MSDN + PSDK.
Tons of complete samples

• 10
• 18
• 14
• 18
• 15