Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Property Grid
  New Posts New Posts RSS Feed - HOWTO: v19.3 - CXTPPropertyGridEnum - how to empty
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

HOWTO: v19.3 - CXTPPropertyGridEnum - how to empty

 Post Reply Post Reply
Author
Message Reverse Sort Order
mgampi View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14 July 2003
Status: Offline
Points: 1194
Post Options Post Options   Thanks (0) Thanks(0)   Quote mgampi Quote  Post ReplyReply Direct Link To This Post Topic: HOWTO: v19.3 - CXTPPropertyGridEnum - how to empty
    Posted: 01 June 2021 at 10:25am
Hello!
What about this issue? We still see the problem in 19.2 and 19.3.
Anyone else?

How to fix it?
Martin

Product: Xtreme Toolkit v 19.0.0, new Projects v 19.1.0
Platform: Windows 10 v 1909 (64bit)
Language: VC++ 2017
Back to Top
mgampi View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14 July 2003
Status: Offline
Points: 1194
Post Options Post Options   Thanks (0) Thanks(0)   Quote mgampi Quote  Post ReplyReply Direct Link To This Post Posted: 21 September 2020 at 3:36am
Hi;

After migration to v19.3, we no longer can 'empty' an enum property.
In older toolkit versions we set -1 in ctor and/or to the SetEnum() funtion. This does the trick.
In v19.3 we get an assert and the display value is not empty anymore.

BTW: The signature and implementation of the SetEnum function is not consistent:

void CXTPPropertyGridItemEnum::SetEnum(int nValue)
{
    m_nValue = nValue;

    if (m_pBindEnum)
    {
        *m_pBindEnum = nValue;
    }

    int nIndex = m_pConstraints->FindConstraint(XTPToULongPtrChecked(nValue));
    CXTPPropertyGridItem::SetValue(m_pConstraints->GetAt(nIndex));
}

Can you see the int --> unsigned long --> int conversion?
Why?

Martin

Product: Xtreme Toolkit v 19.0.0, new Projects v 19.1.0
Platform: Windows 10 v 1909 (64bit)
Language: VC++ 2017
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.156 seconds.