I am trying to use sliders in my resource files like such:

CONTROL "Slider3",IDC_SLIDER3,"msctls_trackbar32",TBS_AUTOTICKS | WS_TABSTOP,268,277,181,20

The problem is the msctls_trackbar32 class. I put
#include <C:\Programs\Microsoft Visual Studio\VC98\Include\commctrl.h> but the dialog box simply does not appear although the resource compiler compiles fine.

I am also wondering how these .h files work with masm.
For example, I could copy a certain file to the include directory, and then all the files referenced by that file, and so on. Then I would have to replace all the <> with "" for the #include lines for it to be able to find them.

This looks kind of tedious, so isn't there a easier way? I tried using the files in the VC++ directories directly, but that has it's own issues.
For example, when compiling
#include <C:\Programs\Microsoft Visual Studio\VC98\MFC\Include\afxres.h>
I get
C:\Programs\Microsoft Visual Studio\VC98\MFC\Include\winres.h(28) : fatal error
RC1015: cannot open include file 'winresrc.h'.
This file is in the same directory as winres.h, and yet it can't find it.

Is there any way to fix this without messing up the files in the VC++ directory?

Now, suppose a given programmer doesn't have VC++. How is he supposed to create resource files and compile them???
Posted on 2002-01-28 11:47:50 by Hel
I don't think you have to go throw this whole stuff.

Just have a look at this short sample, if it's you are looking for.


Posted on 2002-01-28 15:14:33 by Guy
Sorry Guy, but I'm not interested in creating a slider using APIs. The point of resource files is that when you have a complex interface, you don't have to type hundreds of lines of code to create all those controls. Furthermore, you can design the interface more easily, because you don't have to compile and see if any of the controls has a nice width, height, etc.
Posted on 2002-01-28 15:36:27 by Hel
Hi Hel

You probably forgot to:

invoke InitCommonControls

If not, here is a working RadASM project using resource files.

Posted on 2002-01-28 16:08:28 by KetilO
WOW! That was pure genius!!! Who would have thought?

Thanks a lot, KetilO!
Posted on 2002-01-28 17:32:29 by Hel