Project JEDI - Issue Tracker
Mantis Bugtracker

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0004859 [JEDI VCL] 00 JVCL Components major always 2009-07-09 16:19 2009-09-23 16:48
Reporter korecek View Status public  
Assigned To obones
Priority normal Resolution fixed  
Status resolved   Product Version 3.37
Summary 0004859: C++ Builder ambiguity when TBitmap is in the parameters of an event handler
Description Inside 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 Information This happens for the following event handler types:

JvClipboardViewer.TJvOnImageEvent
JvgListBox.TglOnGetDragImageEvent
JvPluginManager.TNewCommandEvent
JvXPBar.TJvXPBarOnDrawItemEvent
Tags No tags attached.
Attached Files zip file icon SimplePluginBCB.ZIP [^] (11,973 bytes) 2009-07-09 16:49
zip file icon SimplePluginBCBx.ZIP [^] (33,580 bytes) 2009-08-13 22:56

- Relationships

-  Notes
(0015985)
korecek (reporter)
2009-08-12 16:20

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.)
(0015986)
obones (administrator)
2009-08-12 17:12

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
(0015987)
obones (administrator)
2009-08-12 18:22

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.
(0015988)
obones (administrator)
2009-08-12 22:44

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.
(0015997)
korecek (reporter)
2009-08-13 22:54

> 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.
(0015998)
obones (administrator)
2009-08-14 10:08

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.
(0016163)
obones (administrator)
2009-09-23 16:48

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-07-31 12:52 korecek Issue Monitored: korecek
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


Mantis 1.1.6[^]
Copyright © 2000 - 2008 Mantis Group
Powered by Mantis Bugtracker