In C++ Builder (I'm using version 2007), if you drop a TImageEnView on a form, you are at risk of having this compilation error:
[C++ Error] Hyieutils.hpp(3345, 54): E2189 extern variable cannot be initialized
The line in question is :
extern PACKAGE void __fastcall IEDrawComboListBoxItem(Controls::TWinControl* TheControl, const Types::TRect &CanvasRect, const AnsiString sText, Controls::TImageList* AnImageList = (Controls::TImageList*)(0x0), short iGlyph = (short)(0xffffffff));
Problem happens if one of the other components on the form is using DesignIntf and DesignEditors. Somewhere in the include chain, the C++ Builder file ToolsAPI.hpp is included. This file defines the following macro:
#define sText "Text"
So there's a conflict between the sText parameter of the IEDrawComboListBoxItem function and the C++ Builder sText macro.
A very easy way to reproduce the problem (at least when using C++ Builder 2007) is to drop a TImageEnView on a form and include the ToolsAPI.hpp file just before the ieview.hpp and imageenview.hpp files:
#include <Toolsapi.hpp>
#include "ieview.hpp"
#include "imageenview.hpp"
Can you fix that? All you have to do is to change the name of the sText parameter to something else (like TheText). The same error is present in the following files:
hyieutils.hpp
ImageEnProc.hpp
iexMetaHelpers.hpp
ImageEnView.hpp
Thanks.
Yannick