Print Page | Close Window

_XTP_EXT_CLASS CXTPZipMemFile

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=13489
Printed Date: 23 June 2025 at 4:35am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: _XTP_EXT_CLASS CXTPZipMemFile
Posted By: mrmathis
Subject: _XTP_EXT_CLASS CXTPZipMemFile
Date Posted: 24 February 2009 at 10:52pm
I just pulled 13.0.0.  My first project barked at me with this error. 
y:\codejock\source\common\XTPSystemHelpers.h(847) : error C2220: warning treated as error - no 'object' file generated
y:\codejock\source\common\XTPSystemHelpers.h(847) : warning C4275: non dll-interface class 'CMemFile' used as base for dll-interface class 'CXTPZipMemFile'
        D:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\atlmfc\include\afx.h(1177) : see declaration of 'CMemFile'
        y:\codejock\source\common\XTPSystemHelpers.h(846) : see declaration of 'CXTPZipMemFile'
I see that _XTP_EXT_CLASS expands to _declspec(dllimport) in the CXTPZipMemFile declaration.  What I don't see is what to do about it.  Any hints as to what is going on?


-------------
--Mike



Replies:
Posted By: Oleg
Date Posted: 25 February 2009 at 2:03am
Hi,
 
_XTP_EXT_CLASS  can't be reason. As you see all our classes declared with _XTP_EXT_CLASS.  Maybe you already have CXTPZipMemFile in your sources... or something.
 
... or maybe you inserted XTPSystemHelpers.h to your project directly.


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


Posted By: mrmathis
Date Posted: 25 February 2009 at 6:41pm
I figured it out.  It was pretty obscure.  We actually have a header, ca_afx.h, that we use in place of afx.h.  Its purpose is to suppress a lot of the Coding Analysis warnings that would otherwise be seen in afx.h.  We're a large shop, and I didn't know that had been done until I started chasing this down.  Here's the file in its entirety:
 

#include <CodeAnalysis/warnings.h>

#pragma warning(push)

#pragma warning(disable: ALL_CODE_ANALYSIS_WARNINGS)

#include <afx.h>

#pragma warning(pop)

 
The included file CodeAnalysis/warnings.h from Microsoft defines ALL_CODE_ANALYSIS_WARNINGS to be a long list of numbers (that doesn't include 4275).  In fact, if you go into the Codejock RibbonSample's stdafx.h and replace the afx* headers with the code above, the same warning I originally cited is generated, along with one other (4251). 
 
The problem is that final "pop" call.  It turns out that inside afx.h, a number of warnings, including 4275, are normally disabled and left that way, and our pop was re-enabling them.
 
Now, as to why this showed up in 13 but not 12, I haven't figured that one out.  I see that XTPResourceManager.h also suppresses these warnings, so my guess is that something changed up the include tree in 13 such that those don't come into play anymore.  Maybe.  Either way, I have modified our ca_afx.h to re-disable the warnings and I'm a happy Codejocker again.
 


-------------
--Mike


Posted By: Oleg
Date Posted: 26 February 2009 at 3:46am
ok :)
Thanks for let us know... for future questions.


-------------
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