Thread: Controls Style: Resource View vs Running App

  1. #1
    Registered User
    Join Date
    Jun 2009
    Location
    Germany
    Posts
    4

    Controls Style: Resource View vs Running App

    Hi,

    I just finished my first C++ Application but there is still one thing I can't get rid of:

    In Visual Studio 2008 I see Vista styled controls. After compiling and running the application they look old fashioned. (See Screenshot)

    Does someone have an idea what could cause this?

  2. #2
    Registered User
    Join Date
    Mar 2007
    Posts
    416
    I'm going to assume you're using visual studios of some genre (obviously), go to project propertys -> Config Props -> linker -> manifest file -> generate manifest, make sure that is set to yes.

  3. #3
    Registered User
    Join Date
    Jun 2009
    Location
    Germany
    Posts
    4
    Thank you so much!

    I am clueless about manifests, but found out that I have to do this:
    Code:
    #pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='x86' publicKeyToken='6595b64144ccf1df' language='*'\"")
    Another entry on my C++ learning list

    By the way: While Vista has shown at least anything, XP has not.

  4. #4
    'Allo, 'Allo, Allo
    Join Date
    Apr 2008
    Posts
    639
    You'll need to call InitCommonControls and link to comctl32.lib to get them to show up.

  5. #5
    Registered User
    Join Date
    Jun 2009
    Location
    Germany
    Posts
    4
    I already noticed a few hours ago that my last post was a little too enthusiastic. On Vista it ran well. On XP, however, it was still the same (no controls). After messing around with some DLLs I only got an error that there is no procedure _except_handler4_common in the linked library msvcrt.dll.

    Finally calling InitCommonControls (and linking the lib) works fine! Thanks! Both of you!

    Code:
    INITCOMMONCONTROLSEX commonControls;
    InitCommonControlsEx(&commonControls);

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Request QueryString Value for CGI style app
    By Tarran in forum C Programming
    Replies: 17
    Last Post: 01-03-2005, 01:56 PM
  2. ASP.NET controls in Office 2003 style?
    By gicio in forum C# Programming
    Replies: 0
    Last Post: 11-07-2003, 11:58 AM
  3. Tab Controls - API
    By -KEN- in forum Windows Programming
    Replies: 7
    Last Post: 06-02-2002, 09:44 AM
  4. Explorer detail view style control.
    By Robert602 in forum Windows Programming
    Replies: 3
    Last Post: 05-20-2002, 12:55 AM
  5. report style list view boxes
    By cppdude in forum Windows Programming
    Replies: 1
    Last Post: 05-01-2002, 05:17 PM