2011年6月2日 星期四

Dialog with SysLink control create fail

Using VS2008 SP1, adding a SysLink Control into a dailog and everything is fine in DEBUG mode.
When running in release mode.... something goes wrong, the dialog won't show up and return -1 fail code...
I traced this problem for a while i found it is the problem of SysLink
 
I saw a blog http://twigstechtips.blogspot.com/2010/03/c-dialogs-with-syslink-control-do-not.html 
 
The main reason the Syslink causes the DialogBox() command to fail is because it requires unicode text support, starting from ComCtl32.dll 6. 
 
add this code will solve the problem
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"")

沒有留言:

張貼留言