Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Property Grid
  New Posts New Posts RSS Feed - Crash on creating new CXTPPropertyGrid()
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Crash on creating new CXTPPropertyGrid()

 Post Reply Post Reply
Author
Message
mojonez View Drop Down
Groupie
Groupie


Joined: 16 September 2008
Status: Offline
Points: 17
Post Options Post Options   Thanks (0) Thanks(0)   Quote mojonez Quote  Post ReplyReply Direct Link To This Post Topic: Crash on creating new CXTPPropertyGrid()
    Posted: 16 September 2008 at 2:53pm
Hi there,
 
I'm upgrading code from v. 11.2.1 to 12.0.1, and I now get a crash error when creating a new property grid (same exact code):
 

int CAVPane::OnCreate(LPCREATESTRUCT lpCreateStruct)

{

if (CWnd::OnCreate(lpCreateStruct) == -1)

return -1;

// PROPERTY GRID

m_wndPropertyGrid = new CXTPPropertyGrid(); // <---crash

if (!m_wndPropertyGrid->Create( rc, this, IDC_PROPERTY_GRID) )

{

AfxMessageBox(_T("Error creating propertygrid."));

}

else

...

 
Crash ocurrs in CXTPPropertyGrid constructor at:

VERIFY(m_pPaintManager->GetItemMetrics()->m_fontNormal.CreateFontIndirect(&lfIcon));

 

Which invokes an attach on the font, whose GDI object is non-null:

BOOL CGdiObject::Attach(HGDIOBJ hObject)

{

ASSERT(m_hObject == NULL); // only attach once, detach on destroy

 

Again, same exact code as v 11.2.1, which works fine.
 
 
Is anyone else successfully creating the grid dynamically?
 
Thanks!
 
Morgan
 
Back to Top
Oleg View Drop Down
Admin Group
Admin Group
Avatar

Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 17 September 2008 at 2:31am
Hi,
 
What platform defines you have in stdafx.h ? Are you sure youdin't change it to Vista ?
 
try change to
 

#if _MSC_VER > 1200
// Modify the following defines if you have to target a platform prior to the ones specified below.
// Refer to MSDN for the latest info on corresponding values for different platforms.
#ifndef WINVER              // Allow use of features specific to Windows 95 and Windows NT 4 or later.
#define WINVER 0x0400       // Change this to the appropriate value to target Windows 98 and Windows 2000 or later.
#endif
#ifndef _WIN32_WINNT        // Allow use of features specific to Windows NT 4 or later.
#define _WIN32_WINNT 0x0400     // Change this to the appropriate value to target Windows 98 and Windows 2000 or later.
#endif
#ifndef _WIN32_WINDOWS      // Allow use of features specific to Windows 98 or later.
#define _WIN32_WINDOWS 0x0410 // Change this to the appropriate value to target Windows Me or later.
#endif
#ifndef _WIN32_IE           // Allow use of features specific to IE 4.0 or later.
#define _WIN32_IE 0x0500    // Change this to the appropriate value to target IE 5.0 or later.
#endif
#endif
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down



This page was generated in 0.078 seconds.