Print Page | Close Window

Assertion in XTPResourceManager

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=12187
Printed Date: 23 June 2025 at 3:21pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Assertion in XTPResourceManager
Posted By: farr02
Subject: Assertion in XTPResourceManager
Date Posted: 18 September 2008 at 6:38am
Hi,

after updating from Toolkit Pro 11.2.2 to Toolkit Pro 12.0.2 I get the following assertion when I start an application that uses Toolkit Pro:



It even happens with the original CodeJock samples (PropertyGrid sample displayed the above message box).
Compilation of the code gives no errors and no warnings. I use the static version of the CodeJock libs (MFC as DLL.).
Any hint what's going wrong?

Best regards,
   Holger





Replies:
Posted By: znakeeye
Date Posted: 18 September 2008 at 8:56am
Read the message! It says clearly what you have done wrong...


Posted By: farr02
Date Posted: 18 September 2008 at 9:43am
Well English is not my native language, so maybe my first post was a little misunderstanding: The program that failed is an official CodeJock example and in its source code you will certainly find:


#if !defined (_AFXDLL) || defined(_XTP_STATICLINK)
#include <XTToolkitPro.rc>
#endif


(in file CodeJockSample.rc which is included by PropertyGrid.rc2).

To produce the assertion compile and link the property grid example (loacted in "\Xtreme ToolkitPro v12.0.2\Samples\PropertyGrid\GridSample") with _XTP_STATICLINK defined (this can be done in stdafx.h) and then just run it.

Best regards,
   Holger.



Posted By: Oleg
Date Posted: 18 September 2008 at 3:02pm
Hi,
resources have no idea what is stdafx.h.
remove #if and #endif.


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: farr02
Date Posted: 19 September 2008 at 3:15am
Hi Oleg,

to reproduce the error pick a sample of your choice, add "#define _XTP_STATICLINK" in the sample's stdafx.h before the include of XTToolkitPro.h file. Build the sample with VS2008 (I have the german version) in debug configuration, run the sample and you get the assert message. I tested it with several of the samples that come with the XTP 12.0.2 installation and in 4 of 5 samples I got the message. (The calendar demos are a fine starting point.)

Now comes the funny part;-)
- I built and ran the 12.0.2 version of the GridSample with XTP 11.2.2 and got no assert message.
- I built and ran the 11.2.2 version of the GridSample with XTP 12.0.2 and got the assert message.
- When using XTP 12.0.2 as DLL and _XTP_STATICLINK not defined the samples run without the assert message using XTP 12.0.2.
It seems there is a bug in the current version of XTP, either in the library itself or in your samples.

BTW in my application there are no defines in the .rc2 files, there is an "#include <XTToolkitPro.rc>" in the .rc2 file, " _XTP_STATICLINK" is defined in the stdafx.h and when running my application in debug configuration I get the assert message when using XTP 12.0.2. The same code runs fine using XTP 11.2.2.

Best regards,
   Holger

PS: I' m out of office the next two weeks.



Posted By: znakeeye
Date Posted: 19 September 2008 at 7:26am

Not so funny actually. The assert was added after 11.2.2, if I remember correctly. It's not a bug. It's there to explicitly notify the programmer of the mistake. Try searching for "rc2" in this forum and you will see why this assert was added ;)

Just follow the instructions in the assert-dialog! Add this line in YourProject.rc2:
 
#include <XTToolkitPro.rc>


Posted By: farr02
Date Posted: 19 September 2008 at 8:05am
As I have written before I have the #include <XTToolkitPro.rc> statement in my application and it runs into the assert message and yes I also have the _XTP_STATICLINK statement before the "#include <XTToolkitPro.h>" statement in my stdafx.h. If I just comment the _XTP_STATICLINK statement my application runs but lacks of  german resources (eg. I see "Customize" instead of "Anpassen").

Please run one of the CodeJock samples as I have described before and then you can tell me if there is an error in nearly all examples or in the lib.

BTW your right this is not funny. For the moment I switched back to 11.2.2 and everything is fine again.

Bye
   Holger




Posted By: Oleg
Date Posted: 22 September 2008 at 5:35am

Did you read my answer ?

resource compiler don't know what defines you have in stdafx.h.  this line in our samples assumes you add _XTP_STATICLINK not in stdafx.h but in defines for resource compiler - open project settings, go to resources and add it here.


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: farr02
Date Posted: 13 November 2008 at 11:34am
Originally posted by oleg oleg wrote:

open project settings, go to resources and add it here.


Hi Oleg,

that indeed is the solution:-)

Best regards,
   Holger




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