MFC controls hide on Windows 7 basic theme
Can anyone please tell me why MFC applications are not displaying correctly in Windows 7 basic theme ?
EDIT: Is there anyone who can guess the problem ?
EDIT:
- Im using vs2008 (same version is used to create this app).
- This particular window is DLL based.For creating that DLL I added these in the Stdafx.h
.
#if defined _M_IX86
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='x86' publicKeyToken='6595b64144ccf1df' language='*'\"")
#elif defined _M_IA64
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='ia64' publicKeyToken='6595b64144ccf1df' language='*'\"")
#elif defined _M_X64
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='amd64' publicKeyToken='6595b64144ccf1df' language='*'\"")
#else
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"")
#endif
- This problem occurs only in this window.
- This window is based on CDialog, inside OnInitDialog() I'm doing these,
.
CDialog::OnInitDialog();
AfxInitRichEdit();
// And Create three more child windows.
- This is how it displayed in basic theme.
But, it is working nicely when I changed to Windows Aero theme.
EDIT: Anyone please ?
- It's advisable to initialize richedit control in the InitInstance function of Application class. I am not sure it will work fine with OnInitDialog.
- Check your program /DLL is UNICODE code or not from the project settings.
- By default Visual Studio 2008 will generate manifest for the program (for EXEs).
- Manifest must be embedded only if the application is UNICODE.
Please check this.
I got the same problem and led down here by google, but none of the answers solved the problem. Then I fixed it only by changing the transparent
attribute of the window/controls to FALSE. Can you try it out?
精彩评论