Thank you for your work.I can not add a icon int the menuitem,can you help me?of course i could convert a bitmap to icon,but you know ,it is not easy ,I was a beginner of vc 6.0,your answer is important to me,could you give me a complete reference of BCMenu if you have . I think I could learn more easy than before .Thank You!!Email email@example.com
I compiled the demo program in vs2008 and there is no error.
However, when I execute the program, there is one problem occurred.
The program cannot be executed on the following line in void BCMenu::InsertSpaces().
VERIFY (SystemParametersInfo (SPI_GETNONCLIENTMETRICS,nm.cbSize,&nm,0));
I answer by myself.
The problem is the same as NewMenu.
I should assign the correct WINVER.
Please see below.
Probably you did not set the right WINVER versionsnumber and the size of NONCLIENTMETRICS will be wrong for XP (Vista will be ok)
=> If the function fails, the return value is zero. To get extended error information, call GetLastError.
Check this output!
#pragma message(" WINVER not defined. Defaulting to 0x0600 (Windows Vista)")
#define WINVER 0x0600
Windows Server 2003 SP1, Windows XP SP2
#define WINVER 0x0502
Windows Server 2003, Windows XP
#define WINVER 0x0501
Thank you for your reply. I do find that I get depracation warnings related to the use of various buffer functions. If I don't want to switch the depracation warnings off it means I have to resolve these issues.
Is it not possible for a "out of the box" VS2005 build to be made available?
I am working with Greek Unicode characters on Vista. I discovered that on Vista, when the "Current language for the non-unicode programs" is set to English, the Unicode menus with Greek characters appear truncated i.e. the words have been cut at the end, with whole words missing some times.
BCMenu predates the release of MS Vista, and digging into the code I discovered that it has a function with the name
which determines the OS type that is used. As it predates Vista, when is run on Vista it defaults to WINNT3! And this causes all the problems. I have changed the function so when run under MS Vista (or any future versions MS Windows) it returns WINXP as the OS type. This has solved the problem of the truncated menu width.
Now all the tests when run on a 32bit Vista installation. The change most probably will work also for Vist 64-bit.
I include the changed code of the function for your reference: