Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - Assertion in  XTPResourceManager
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Assertion in XTPResourceManager

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


Joined: 10 May 2005
Status: Offline
Points: 51
Post Options Post Options   Thanks (0) Thanks(0)   Quote farr02 Quote  Post ReplyReply Direct Link To This Post Topic: Assertion in XTPResourceManager
    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


Back to Top
znakeeye View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 July 2006
Status: Offline
Points: 1672
Post Options Post Options   Thanks (0) Thanks(0)   Quote znakeeye Quote  Post ReplyReply Direct Link To This Post Posted: 18 September 2008 at 8:56am
Read the message! It says clearly what you have done wrong...
Back to Top
farr02 View Drop Down
Groupie
Groupie


Joined: 10 May 2005
Status: Offline
Points: 51
Post Options Post Options   Thanks (0) Thanks(0)   Quote farr02 Quote  Post ReplyReply Direct Link To This Post 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.

Back to Top
Oleg View Drop Down
Admin Group
Admin Group


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: 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
Back to Top
farr02 View Drop Down
Groupie
Groupie


Joined: 10 May 2005
Status: Offline
Points: 51
Post Options Post Options   Thanks (0) Thanks(0)   Quote farr02 Quote  Post ReplyReply Direct Link To This Post 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.

Back to Top
znakeeye View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 July 2006
Status: Offline
Points: 1672
Post Options Post Options   Thanks (0) Thanks(0)   Quote znakeeye Quote  Post ReplyReply Direct Link To This Post 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>
Back to Top
farr02 View Drop Down
Groupie
Groupie


Joined: 10 May 2005
Status: Offline
Points: 51
Post Options Post Options   Thanks (0) Thanks(0)   Quote farr02 Quote  Post ReplyReply Direct Link To This Post 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


Back to Top
Oleg View Drop Down
Admin Group
Admin Group


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: 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
Back to Top
farr02 View Drop Down
Groupie
Groupie


Joined: 10 May 2005
Status: Offline
Points: 51
Post Options Post Options   Thanks (0) Thanks(0)   Quote farr02 Quote  Post ReplyReply Direct Link To This Post 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

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.059 seconds.