Dev-cpp XP manifest file.

Please support our C++ advertiser: Intel Parallel Studio Home
Thread Solved

Join Date: Mar 2009
Posts: 7
Reputation: freddan007 is an unknown quantity at this point 
Solved Threads: 0
freddan007 freddan007 is offline Offline
Newbie Poster

Dev-cpp XP manifest file.

 
0
  #1
Mar 6th, 2009
Hello,
I've started learning how to make simple GUI programs in cpp using theforgers tutorial. However I was going to add XP style to my program and I found a page that showed me exacly how to do it for VC++ 6. The problem when I had added the lines in my resource.h file and my res.rc file was that my program refused to start. The window didn't show up. When I removed the line in the resourcefile it showed up again but with the old 95/98/ME/2000 style. What should i do to make it work.

This is my .rc file:
  1. //Microsoft Developer Studio generated resource script.
  2. //
  3. #include "resource.h"
  4.  
  5.  
  6. #define APSTUDIO_READONLY_SYMBOLS
  7. /////////////////////////////////////////////////////////////////////////////
  8. //
  9. // Generated from the TEXTINCLUDE 2 resource.
  10. //
  11. #define APSTUDIO_HIDDEN_SYMBOLS
  12. #include "windows.h"
  13. #undef APSTUDIO_HIDDEN_SYMBOLS
  14.  
  15.  
  16. /////////////////////////////////////////////////////////////////////////////
  17. #undef APSTUDIO_READONLY_SYMBOLS
  18.  
  19. /////////////////////////////////////////////////////////////////////////////
  20. // English (U.S.) resources
  21.  
  22. #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
  23. #ifdef _WIN32
  24. LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
  25. #pragma code_page(1252)
  26. #endif //_WIN32
  27.  
  28. #ifdef APSTUDIO_INVOKED
  29. /////////////////////////////////////////////////////////////////////////////
  30. //
  31. // TEXTINCLUDE
  32. //
  33.  
  34. 1 TEXTINCLUDE DISCARDABLE
  35. BEGIN
  36. "resource.h\0"
  37. END
  38.  
  39. 2 TEXTINCLUDE DISCARDABLE
  40. BEGIN
  41. "#define APSTUDIO_HIDDEN_SYMBOLS\r\n"
  42. "#include ""windows.h""\r\n"
  43. "#undef APSTUDIO_HIDDEN_SYMBOLS\r\n"
  44. "\0"
  45. END
  46.  
  47. 3 TEXTINCLUDE DISCARDABLE
  48. BEGIN
  49. "\0"
  50. END
  51.  
  52. #endif // APSTUDIO_INVOKED
  53.  
  54.  
  55. MANIFEST_RESOURCE_ID 24 MOVEABLE PURE "projekt1.exe.manifest"
  56.  
  57. /////////////////////////////////////////////////////////////////////////////
  58. //
  59. // Dialog
  60. //
  61.  
  62. IDD_MAIN DIALOG DISCARDABLE 0, 0, 207, 156
  63. STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
  64. CAPTION "Simply refreshed"
  65. FONT 8, "MS Sans Serif"
  66. BEGIN
  67. LTEXT "Username: ",IDC_STATIC,3,8,140,8
  68. LTEXT "Password: ",IDC_STATIC,3,22,140,8
  69. EDITTEXT IDC_USERNAME,40,7,70,12,ES_AUTOHSCROLL
  70. EDITTEXT IDC_PASSWORD,40,21,70,12,ES_PASSWORD
  71.  
  72.  
  73. PUSHBUTTON "Login",IDC_LOGIN,113,7,50,14
  74. PUSHBUTTON "&Remove",IDC_REMOVE,150,47,50,14
  75. PUSHBUTTON "&Clear",IDC_CLEAR,150,63,50,14
  76. LTEXT "This item was hhghghghghghgghhghgadded\njj",IDC_STATIC,7,141,66,16
  77. CTEXT "-",IDC_SHOWCOUNT,77,141,32,8
  78. LTEXT "times",IDC_STATIC,114,141,17,8
  79. END
  80.  
  81.  
  82. /////////////////////////////////////////////////////////////////////////////
  83. //
  84. // DESIGNINFO
  85. //
  86.  
  87. #ifdef APSTUDIO_INVOKED
  88. GUIDELINES DESIGNINFO DISCARDABLE
  89. BEGIN
  90. IDD_MAIN, DIALOG
  91. BEGIN
  92. LEFTMARGIN, 7
  93. RIGHTMARGIN, 200
  94. VERTGUIDE, 145
  95. VERTGUIDE, 150
  96. TOPMARGIN, 7
  97. BOTTOMMARGIN, 149
  98. END
  99. END
  100. #endif // APSTUDIO_INVOKED
  101.  
  102. #endif // English (U.S.) resources
  103. /////////////////////////////////////////////////////////////////////////////
and my resource.h file:

  1. //{{NO_DEPENDENCIES}}
  2. // Microsoft Developer Studio generated include file.
  3. // Used by ctl_one.rc
  4. //
  5.  
  6. #define MANIFEST_RESOURCE_ID 1
  7.  
  8. #define IDC_STATIC -1
  9. #define IDD_MAIN 101
  10. #define IDC_TEXT 1000
  11. #define IDC_NUMBER 1001
  12. #define IDC_LIST 1002
  13. #define IDC_LOGIN 1003
  14. #define IDC_CLEAR 1004
  15. #define IDC_REMOVE 1005
  16. #define IDC_SHOWCOUNT 1007
  17. #define IDC_USERNAME 1006
  18. #define IDC_PASSWORD 1008
  19.  
  20.  
  21. // Next default values for new objects
  22. //
  23. #ifdef APSTUDIO_INVOKED
  24. #ifndef APSTUDIO_READONLY_SYMBOLS
  25. #define _APS_NEXT_RESOURCE_VALUE 102
  26. #define _APS_NEXT_COMMAND_VALUE 40001
  27. #define _APS_NEXT_CONTROL_VALUE 1009
  28. #define _APS_NEXT_SYMED_VALUE 101
  29. #endif
  30. #endif

Thanks.
Last edited by freddan007; Mar 6th, 2009 at 1:29 pm.
Reply With Quote Quick reply to this message  
Join Date: Oct 2008
Posts: 476
Reputation: nucleon has a spectacular aura about nucleon has a spectacular aura about 
Solved Threads: 91
nucleon's Avatar
nucleon nucleon is offline Offline
Posting Pro in Training

Re: Dev-cpp XP manifest file.

 
0
  #2
Mar 6th, 2009
You haven't posted the manifest file.
Did you InitCommonControlsEx() ?
Reply With Quote Quick reply to this message  
Join Date: Mar 2009
Posts: 7
Reputation: freddan007 is an unknown quantity at this point 
Solved Threads: 0
freddan007 freddan007 is offline Offline
Newbie Poster

Re: Dev-cpp XP manifest file.

 
0
  #3
Mar 6th, 2009
My manifest file:
  1. <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
  2. <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
  3. <assemblyIdentity
  4. version="1.0.0.0"
  5. processorArchitecture="X86"
  6. name="Zhorn.Styles.Styles"
  7. type="win32"
  8. />
  9. <description>Styles - demonstrate XP styles</description>
  10. <dependency>
  11. <dependentAssembly>
  12. <assemblyIdentity
  13. type="win32"
  14. name="Microsoft.Windows.Common-Controls"
  15. version="6.0.0.0"
  16. processorArchitecture="X86"
  17. publicKeyToken="6595b64144ccf1df"
  18. language="*"
  19. />
  20. </dependentAssembly>
  21. </dependency>
  22. </assembly>
I added InitCommonControlsEx(); at a random location but the compiler said it wasn't defined. What library is InitCommonControlsEx() in?
Reply With Quote Quick reply to this message  
Join Date: Oct 2008
Posts: 476
Reputation: nucleon has a spectacular aura about nucleon has a spectacular aura about 
Solved Threads: 91
nucleon's Avatar
nucleon nucleon is offline Offline
Posting Pro in Training

Re: Dev-cpp XP manifest file.

 
0
  #4
Mar 6th, 2009
InitCommonControlsEx (see the table at the bottom)
Try putting it in your WM_CREATE handler.
Reply With Quote Quick reply to this message  
Join Date: Mar 2009
Posts: 7
Reputation: freddan007 is an unknown quantity at this point 
Solved Threads: 0
freddan007 freddan007 is offline Offline
Newbie Poster

Re: Dev-cpp XP manifest file.

 
0
  #5
Mar 6th, 2009
I still get an error:
  1. Main.cpp In function `BOOL DlgProc(HWND__*, UINT, WPARAM, LPARAM)':
  2. Main.cpp `InitCommonControlsEx' undeclared (first use this function)
  3. (Each undeclared identifier is reported only once for each function it appears in.)
  4. Makefile.win [Build Error] [Main.o] Error 1

My includes:
  1. #include <windows.h>
  2. #include <commctrl.h>
  3. #include "resource.h"
  4. using namespace std;

I added the WM_CREATE in the Message switch

  1. case WM_CREATE:
  2. InitCommonControlsEx();
  3. break;
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 978
Reputation: mitrmkar is just really nice mitrmkar is just really nice mitrmkar is just really nice mitrmkar is just really nice mitrmkar is just really nice 
Solved Threads: 208
mitrmkar mitrmkar is offline Offline
Posting Shark

Re: Dev-cpp XP manifest file.

 
0
  #6
Mar 6th, 2009
Originally Posted by freddan007 View Post
I still get an error:
  1. Main.cpp In function `BOOL DlgProc(HWND__*, UINT, WPARAM, LPARAM)':
  2. Main.cpp `InitCommonControlsEx' undeclared (first use this function)
  3. (Each undeclared identifier is reported only once for each function it appears in.)
  4. Makefile.win [Build Error] [Main.o] Error 1
In your project, #define _WIN32_IE to at least 0x0300 .

InitCommonControlsEx() takes a pointer to a INITCOMMONCONTROLSEX struct. You are not using the function correctly ...

I added the WM_CREATE in the Message switch
  1. case WM_CREATE:
  2. InitCommonControlsEx();
  3. break;
Reply With Quote Quick reply to this message  
Join Date: Mar 2009
Posts: 7
Reputation: freddan007 is an unknown quantity at this point 
Solved Threads: 0
freddan007 freddan007 is offline Offline
Newbie Poster

Re: Dev-cpp XP manifest file.

 
0
  #7
Mar 6th, 2009
I added
#define _WIN32_IE 0x0301
in resources.h and created the struct
  1. INITCOMMONCONTROLSEX InitCtrlEx;
  2. InitCtrlEx.dwICC = ICC_STANDARD_CLASSES;
  3. InitCtrlEx.dwSize=sizeof(INITCOMMONCONTROLSEX);
  4. InitCommonControlsEx(&InitCtrlEx);
but the INITCOMMONCONTROLSEX seems to be undeclared:

  1. Main.cpp `INITCOMMONCONTROLSEX' undeclared (first use this function)
  2.  
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 978
Reputation: mitrmkar is just really nice mitrmkar is just really nice mitrmkar is just really nice mitrmkar is just really nice mitrmkar is just really nice 
Solved Threads: 208
mitrmkar mitrmkar is offline Offline
Posting Shark

Re: Dev-cpp XP manifest file.

 
0
  #8
Mar 6th, 2009
resource.h is not the place to define _WIN32_IE. Do it instead above the #includes, i.e.
  1. #define _WIN32_IE 0x0301
  2. #include <windows.h>
  3. #include <commctrl.h>

Or alternatively in the project's configuration.
Reply With Quote Quick reply to this message  
Join Date: Mar 2009
Posts: 7
Reputation: freddan007 is an unknown quantity at this point 
Solved Threads: 0
freddan007 freddan007 is offline Offline
Newbie Poster

Re: Dev-cpp XP manifest file.

 
0
  #9
Mar 6th, 2009
Thank you it works now! : D
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Other Threads in the C++ Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC