Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS General Discussion » WinNT & Prof-UIS & VC.NET & Menu Problem Collapse All
Subject Author Date
genka Oct 11, 2002 - 2:50 AM

Hallo,

if i start program with Prof-UIS under WinNT then i have a no menu item’s in menu bar. It is only then i have compiled with VC.NET. Your examples from Bin6 worked OK. If i compile your examples with VC.NET it is not OK :-(
if i compile your ProfStudio example with VC.NET and start it under WinNT - Error.
I have all compiled as Static - no dll’s.

Tips?

Thanks.

Russian:
Pri zapuske programmi skompilirowannoy w VC.NET pod WinNT menubar risuetsja pustim. S waschimi primerami proishodit toze samoe :-( a profstudio wiletaet pri starte s soobscheniem ob oschibke.

U was est’ kakie-nibud’ predpolozenija?

wbw,
genka

Sergiy Lavrynenko Oct 11, 2002 - 12:25 PM

Hi Genka,

You faced a stardard problem. Please add these macro definions to your C++ project settings and to the Prof-UIS library project settings:

_WIN32_IE=0x0400
_WIN32_WINNT=0x0400

Then, rebuild both Prof-UIS lib and your project. That should make your program WinNT4 compatible.

Here is the explanation of the snag.

Many structures in Win32 automatically include additional members if any of those preprocessor macro symbols are set to values equal to or greater than 0x0500. For example, MENUITEMINFO in the WINUSER.H is defined as:


#if(WINVER >= 0x0400)
typedef struct tagMENUITEMINFOA
{
UINT cbSize;
UINT fMask;
UINT fType; // used if MIIM_TYPE (4.0) or MIIM_FTYPE (>4.0)
UINT fState; // used if MIIM_STATE
UINT wID; // used if MIIM_ID
HMENU hSubMenu; // used if MIIM_SUBMENU
HBITMAP hbmpChecked; // used if MIIM_CHECKMARKS
HBITMAP hbmpUnchecked; // used if MIIM_CHECKMARKS
DWORD dwItemData; // used if MIIM_DATA
LPSTR dwTypeData; // used if MIIM_TYPE (4.0) or MIIM_STRING (>4.0)
UINT cch; // used if MIIM_TYPE (4.0) or MIIM_STRING (>4.0)
#if (_WIN32_WINNT >= 0x0500)
HBITMAP hbmpItem; // used if MIIM_BITMAP
#endif
} MENUITEMINFOA, FAR *LPMENUITEMINFOA;


If you compile your program with _WIN32_WINNT equal to 0x0500 or greater, then that structure is larger than the one several WinNT4 API functions are waiting for. In this case WinNT4 API frequently causes failures.

So compile your program with the suggested macro definions and it will be compatible with Win9x, WinME, WinNT4, Win2K, WinXP, and, probably, future Windows OSes.

Best regards,
Sergiy Lavrynenko

genka Oct 14, 2002 - 2:46 AM

Hallo Sergiy,

if i make it then i have a this Error:
\Programme\FOSS Software Inc\Prof-UIS\Src\ExtPopupMenuWnd.cpp(5637) : error C2065: ’WS_EX_LAYOUTRTL’ : undeclared identifier

\Programme\FOSS Software Inc\Prof-UIS\Src\ExtPopupMenuWnd.cpp(5637) : error C2297: ’&’ : illegal, right operand has type ’’unknown-type’’

i think it is not all changes ,-)

thanks for your tip!

WBW,
genka

Sergiy Lavrynenko Oct 15, 2002 - 2:39 AM

Hi Genka,

The compilation problem in the ExtPopupMenuWnd.cpp(5637) can be easily fixed:

#if (WINVER >= 0x0500)
ASSERT( WS_EX_LAYOUTRTL == 0x00400000L );
#endif
if( ( (DWORD)::GetWindowLong(hWndTopLevelParent,GWL_EXSTYLE))&0x00400000L // 0x00400000L is WS_EX_LAYOUTRTL under Win 5x
)
CRect::SwapLeftRight( &rcBkUpdate );

Please catch my mail with more detailed description of the WinNT4 compatibility problem.

Best regards,
Sergiy Lavrynenko