Print Page | Close Window

Crash on creating new CXTPPropertyGrid()

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Property Grid
Forum Description: Topics Related to Codejock Property Grid
URL: http://forum.codejock.com/forum_posts.asp?TID=12167
Printed Date: 22 November 2024 at 12:08am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Crash on creating new CXTPPropertyGrid()
Posted By: mojonez
Subject: Crash on creating new CXTPPropertyGrid()
Date 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
 



Replies:
Posted By: Oleg
Date 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



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net