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 Tech Support » Why CExtSpinWnd don't have SetPos32() member function? Collapse All
Subject Author Date
Vincent Lin Feb 14, 2007 - 2:34 AM

Why CExtSpinWnd don’t have SetPos32() member function?
the spin positon will reset to zero while CExtEdit value is great than 0x7fff

Technical Support Feb 14, 2007 - 11:16 AM

The CExtSpinWnd class is derived from CSpinButtonCtrl. So derives all the methods and functionality from the latter.

Vincent Lin Feb 14, 2007 - 7:08 PM

what should i do while spin position is large than 0x7fff? I use GetPos() to get it’s position, and always got 0x10000 .

Technical Support Feb 15, 2007 - 4:14 AM

MSDN says: For SetRange, neither limit can be greater than UD_MAXVAL nor less than UD_MINVAL; in addition, the difference between the two limits cannot exceed UD_MAXVAL. SetRange32 places no restrictions on the limits; use any integers.

So did you try the SetRange32 method? By the way, SetPos32 and GetPos32 are available in the CSpinButtonCtrl class. You can use them for setting and getting 32-bit values.

Vincent Lin Feb 15, 2007 - 4:28 AM

I had use SetRange32() to my spin, and the compiler (VisualStudio 2005) says "SetPos32() is not a member of CSpinButtonCtrl", why ?

Technical Support Feb 15, 2007 - 5:05 AM

Here is how these methods are declared in the source files:

#if _WIN32_IE >= 0x0500
	int GetPos32(LPBOOL lpbError = NULL) const;
	int SetPos32(int nPos);
#endif
As you can see you should declare the _WIN32_IE constant equal to 0x0500 somewhere in the StdAfx.h file or, which is better, in the project settings. But anyway you can directly send the UDM_GETPOS32 and UDM_SETPOS32 messages to the control using SendMessage. Please note these methods are available only starting from Internet Explorer 5.