Sign in to follow this  

Dialog Error

This topic is 4743 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'm having some problems with adding a TAB Control to my dialog. I've put an app together to illustrate this. As is, the app will fail to display the dialog, but if the TAB Control is deleted off the dialog, then the dialog displays fine. Apparently I can't attach a file to this thread, so here is a link to a thread where the sample app can be downloaded: http://www.codeguru.com/forum/showthread.php?t=321786 What am I doing wrong? Btw. don't mind the coding, it's just to illustrate my problem.

Share this post


Link to post
Share on other sites
Tab Controls need to have InitCommonControls called (or InitCommonControlsEx with ICC_TAB_CLASSES flag set).

Include this in your main.cpp after the other includes:

#include <commctrl.h>
#pragma comment( lib, "comctl32.lib" )

And at the beginning of your LaunchDialog function call

InitCommonControls();

The dialog works. The content of the dialog looks a bit weird though (group boxes under the tab control are drawn on top).

Share this post


Link to post
Share on other sites
Thanks Endurion,
This seems to do the trick...

The app was just an example, I didn't add all the functionality to the dialog. The original projects has many more controls and code to handle them.

Anyway, I appreciate your time to look at my problem.

Thanks,
John

[Edited by - jj_bravo on December 16, 2004 9:11:57 AM]

Share this post


Link to post
Share on other sites
I guess I learned something new today :) ... I don't have to use InitCommonControlsEx(), I could add a manifest instead.

From msdn:
Windows XP: If a manifest is used, InitCommonControlsEx is not required

This is a manifest from a DX sample framework:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity
version="1.0.0.0"
processorArchitecture="X86"
name="Microsoft.DirectX SDK"
type="win32"
/>
<description>DirectX SDK Sample Program.</description>
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="X86"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>
</assembly>

Share this post


Link to post
Share on other sites

This topic is 4743 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this