View Issue Details

IDProjectCategoryView StatusLast Update
0004177JEDI VCL00 JVCL Componentspublic2007-07-11 13:18
ReporterOlegAssigned ToAHUser 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product Version3.32 
Target VersionFixed in Version3.34 
Summary0004177: JvThemes.pas generated header file is "incompatible" with some third party libraries
DescriptionUsage of unit "JvThemes" and its header file "JvThemes.hpp" is not possibe in C++ units if some third party libraries also used (ThemeSrv, Raize Components) - because constants "teButton" ... "twSmallFrameBottomSizingTemplate" declared differently, using enums (ThemeSrv, Raize) and using "#define" (in JVCL).

For example:
  ----------------------------------------------------------------------------
  file "RzThemeSrv.hpp" (from Raize 4.0.1):
  ...
  enum TThemedElement { teButton, teClock, teComboBox, teEdit, teExplorerBar, teHeader, teListView, teMenu, tePage, teProgress, teRebar, teScrollBar, teSpin, teStartPanel, teStatus, teTab, teTaskBand, teTaskBar, teToolBar, teToolTip, teTrackBar, teTrayNotify, teTreeview, teWindow };
  ...
  ----------------------------------------------------------------------------
  compiler errors:

  [C++ Error] RzThemeSrv.hpp(29): E2184 Enum syntax error
    Full parser context
      ...
      ...: #include ...\RzDBStat.hpp
      RzDBStat.hpp(13): #include ...\RzCommon.hpp
      RzCommon.hpp(17): #include ...\RzThemeSrv.hpp
      RzThemeSrv.hpp(26): namespace Rzthemesrv

  [C++ Error] RzThemeSrv.hpp(29): E2040 Declaration terminated incorrectly
    Full parser context
      ...
      ...: #include ...\RzDBStat.hpp
      RzDBStat.hpp(13): #include ...\RzCommon.hpp
      RzCommon.hpp(17): #include ...\RzThemeSrv.hpp
      RzThemeSrv.hpp(26): namespace Rzthemesrv

  [C++ Error] RzThemeSrv.hpp(29): E2190 Unexpected }
    Full parser context
      ...
      ...: #include ...\RzDBStat.hpp
      RzDBStat.hpp(13): #include ...\RzCommon.hpp
      RzCommon.hpp(17): #include ...\RzThemeSrv.hpp
  ----------------------------------------------------------------------------


This occured because unit "JvThemes.pas" declares constants such as:
  ----------------------------------------------------------------------------
    const
      teButton = {$IFDEF COMPILER7_UP}Themes{$ELSE}ThemeSrv{$ENDIF}.teButton;
    ...
    twSmallFrameBottomSizingTemplate =
      {$IFDEF COMPILER7_UP}Themes{$ELSE}ThemeSrv{$ENDIF}.twSmallFrameBottomSizingTemplate;
  ----------------------------------------------------------------------------
which are then "translated" into header file as:
  ----------------------------------------------------------------------------
  #define teButton (Themesrv::TThemedElement)(0)
  ...
  #define twSmallFrameBottomSizingTemplate (Themesrv::TThemedWindow)(116)
  ----------------------------------------------------------------------------
- the generated header file contains such declarations using "#define" directive, that leads to the conflict in later C++ declarations.
TagsNo tags attached.

Activities

obones

2007-07-11 07:02

administrator   ~0013563

The HPP files are generated by the compiler itself, we can't do much about that.

And you could change the order of include files and get sorted.

AHUser

2007-07-11 13:17

developer   ~0013565

C++Builder 2007 generates
static const Themes::TThemedElement teButton = (Themes::TThemedElement)(0);

Despite this I have added the {$EXTERNALSYM xxx} for every enum alias.

Issue History

Date Modified Username Field Change
2007-07-11 06:56 Oleg New Issue
2007-07-11 07:02 obones Note Added: 0013563
2007-07-11 07:02 obones Status new => feedback
2007-07-11 13:17 AHUser Status feedback => resolved
2007-07-11 13:17 AHUser Fixed in Version => Daily / SVN
2007-07-11 13:17 AHUser Resolution open => fixed
2007-07-11 13:17 AHUser Assigned To => AHUser
2007-07-11 13:17 AHUser Note Added: 0013565