View Issue Details

IDProjectCategoryView StatusLast Update
0004859JEDI VCL00 JVCL Componentspublic2009-09-23 16:48
ReporterkorecekAssigned Toobones 
PrioritynormalSeveritymajorReproducibilityalways
Status resolvedResolutionfixed 
Product Version3.37 
Target VersionFixed in Version3.39 
Summary0004859: C++ Builder ambiguity when TBitmap is in the parameters of an event handler
DescriptionInside TJvPluginManager, there is incompatibility problem in function prototype of the OnNewCommad Event function which show errors:
[C++ Error] PlugInDemoU.h(49): E2015 Ambiguity between 'TBitmap'
and 'Windows::TBitmap'
[C++ Error] PlugInDemoU.cpp(102): E2015 Ambiguity between
'TBitmap' and 'Windows::TBitmap'

Function prototype is following:
 void __fastcall uilPluginManagerNewCommand(TObject *Sender,
          AnsiString ACaption, AnsiString AHint, AnsiString AData,
          TShortCut AShortCut, TBitmap *ABitmap, TNotifyEvent AEvent);

I checked BCB Compatibility Guide and I think that it could be already
described problem.
(... "{$HPPEMIT '#define SOMETYPE SomeDomain::SOMETYPE'}" )
Additional InformationThis happens for the following event handler types:

JvClipboardViewer.TJvOnImageEvent
JvgListBox.TglOnGetDragImageEvent
JvPluginManager.TNewCommandEvent
JvXPBar.TJvXPBarOnDrawItemEvent
TagsNo tags attached.

Activities

2009-07-09 16:49

 

SimplePluginBCB.ZIP (11,973 bytes)

korecek

2009-08-12 16:20

reporter   ~0015985

I little experimented and I am not able to find any simple
solution.
What is worse during my tests I found very same problem in
another component. It is TJvXPBar component and its OnDrawItem
Event. The OnDrawItem Event function also has TBitmap
parameter and if I add this Event function into the project I
also got error :
E2015 Ambiguity between 'TBitmap' and 'Windows::TBitmap'

At the moment I thing that it is not only JvPluginManager
problem but it is more general problem in OnEventXXX function
interfaces (if there is used TBitmap *ABitmap parameter.)

obones

2009-08-12 17:12

administrator   ~0015986

Just so you know, I just tried to drop a JvXPBar under BCB2006, I did not have such problem.
This seems to be very specific to C6

obones

2009-08-12 18:22

administrator   ~0015987

Ok, I tried with your sample application. To fix the issue, just add this line:

#define TBitmap Graphics::TBitmap

It needs to be added in PlugInDemoU.h just before the TForm1 declaration.

I also tried creating a blank application in C6 and drop a TJvXPBar, and the same fix applies. I'm not sure it can be added in the generated hpp files though.

obones

2009-08-12 22:44

administrator   ~0015988

I have updated the issue title and additional details to mention the 4 instances where this happens in the JVCL.
I'm looking for a solution, but nothing ideal came up yet.

korecek

2009-08-13 22:54

reporter   ~0015997

> This seems to be very specific to C6

The definition of "#define TBitmap Graphics::TBitmap" as you
described works quite in BCB6 but also in BCB2006. (I experimented in the file too but bad way and on bad place ... :-( )
BCB2006:
1. First I added following conditional definition into PlugInemoU.h :
/* Use definition only in BCB6 */
#if ( __BCPLUSPLUS__ <= 0x0564 )
#define TBitmap Graphics::TBitmap
#endif
2. I added a new Command 4 into Plugin DLL
3. I create also same Simple Plugin project under BCB2006.
   (But not from blank project but converted from BCB6...)
4. I compiled both projects under BCB2006 and I got known above
   described E2015 error
5. I commented out #if .. and #endif rows and compilation under
   BCB2006 was successful.
6. Updated example included ...

So I guess that the problem is most probably relative to BCB2006 too.

2009-08-13 22:56

 

SimplePluginBCBx.ZIP (33,580 bytes)

obones

2009-08-14 10:08

administrator   ~0015998

Actually it shows up in all versions that I tested, that means C6, RS2006, RS2007 and RS2009
There is a solution, but it means changing the event handlers for everyone, including the delphi side.

obones

2009-09-23 16:48

administrator   ~0016163

TJvBitmap has been added in JvJVCLUtils and used instead of TBitmap. This solves the issue and is now in SVN

Issue History

Date Modified Username Field Change
2009-07-09 16:19 korecek New Issue
2009-07-09 16:49 korecek File Added: SimplePluginBCB.ZIP
2009-07-09 17:11 obones Assigned To => obones
2009-07-09 17:12 obones Status new => assigned
2009-08-12 16:20 korecek Note Added: 0015985
2009-08-12 17:12 obones Note Added: 0015986
2009-08-12 18:22 obones Note Added: 0015987
2009-08-12 18:22 obones Status assigned => feedback
2009-08-12 22:43 obones Summary JvPluginManager Compilation Error => C++ Builder ambiguity when TBitmap is in the parameters of an event handler
2009-08-12 22:43 obones Description Updated
2009-08-12 22:43 obones Additional Information Updated
2009-08-12 22:44 obones Note Added: 0015988
2009-08-13 22:54 korecek Note Added: 0015997
2009-08-13 22:56 korecek File Added: SimplePluginBCBx.ZIP
2009-08-14 10:08 obones Note Added: 0015998
2009-09-23 16:48 obones Note Added: 0016163
2009-09-23 16:48 obones Status feedback => resolved
2009-09-23 16:48 obones Fixed in Version => Daily / SVN
2009-09-23 16:48 obones Resolution open => fixed