Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

C++Builder1.0 Component does not port to 3.0 or higher

Status
Not open for further replies.

joewolter

Programmer
Aug 31, 2001
4
0
0
US
I get 3 errors and 2 warnings when I try to compile in 3.0.

(2)Error::Cannot Override a dynamic with a virtual function
virtual void __fastcall KeyDown();
virtual void __fastcall MouseDown();

(2)Warning::GetChildren hides virtual function __fastcall Controls::TWinControl::GetChildern()
virtual void __fastcall GetChildren(Classes::TGetChildProc Proc);

(1)Error::Too few parameters in call to __fastcall Controls::TWinControl::GetChildern()
void __fastcall TFurunoRadioGroup::GetChildren(Classes::TGetChildProc Proc)
{
TCustomControl::GetChildren(Proc);
}

Any help would be appreciated,
Joe


/////////////////////////////////////////////////////////////////////////////
FurunoRadioGroup.h
/////////////////////////////////////////////////////////////////////////////

//---------------------------------------------------------------------------
#ifndef FurunoRadioGroupH
#define FurunoRadioGroupH
//---------------------------------------------------------------------------
#include <vcl\SysUtils.hpp>
#include <vcl\Controls.hpp>
#include <vcl\Classes.hpp>
#include <vcl\Forms.hpp>
#include <vcl\Graphics.hpp>
#include <vcl\Messages.hpp>
#include <vcl\Windows.hpp>
#include <vcl\System.hpp>
#include <vcl\consts.hpp>
//---------------------------------------------------------------------------
enum TFurunoRadioHighlighting { frhUnderline, frhInverse };

//---------------------------------------------------------------------------
class TFurunoRadioGroup : public TCustomControl
{
private:
Classes::TList* FButtons;
Classes::TStrings* FItems;
int FItemIndex;
int FColumns;
TFurunoRadioHighlighting FHighlighting;
bool FDrawRect;
bool FReading;
bool FUpdating;
Classes::TNotifyEvent FOnResize;
void __fastcall ArrangeButtons(void);
void __fastcall ButtonClick(System::TObject* Sender);
void __fastcall ItemsChange(System::TObject* Sender);
void __fastcall SetButtonCount(int Value);
void __fastcall SetColumns(int Value);
void __fastcall SetItemIndex(int Value);
void __fastcall SetItems(Classes::TStrings* Value);
void __fastcall SetDrawRect(bool Value);
void __fastcall SetHighlighting(TFurunoRadioHighlighting Value);
void __fastcall UpdateButtons(void);
MESSAGE void __fastcall CMWantSpecialKey(TCMWantSpecialKey &Message);
HIDESBASE MESSAGE void __fastcall CMEnabledChanged(Messages::TMessage &Message);
HIDESBASE MESSAGE void __fastcall CMFontChanged(Messages::TMessage &Message);
HIDESBASE MESSAGE void __fastcall WMSize(Messages::TWMSize &Message);

protected:
virtual void __fastcall KeyDown(Word &Key, TShiftState Shift);
virtual void __fastcall MouseDown(TMouseButton button, TShiftState shift, int x, int y);
virtual void __fastcall AlignControls(Controls::TControl* AControl, Windows::TRect &Rect);
virtual void __fastcall Paint(void);
virtual void __fastcall ReadState(Classes::TReader* Reader);
virtual bool __fastcall CanModify(void);
virtual void __fastcall GetChildren(Classes::TGetChildProc Proc);

public:
__fastcall TFurunoRadioGroup(TComponent* Owner);
__fastcall virtual ~TFurunoRadioGroup(void);
public:
__fastcall TFurunoRadioGroup(HWND ParentWindow) : TCustomControl(ParentWindow) { };

BEGIN_MESSAGE_MAP
MESSAGE_HANDLER(CM_WANTSPECIALKEY , TCMWantSpecialKey,CMWantSpecialKey)
END_MESSAGE_MAP(TCustomControl)

__published:
__property int Columns = {read=FColumns, write=SetColumns, default=1};
__property int ItemIndex = {read=FItemIndex, write=SetItemIndex, default=-1};
__property Classes::TStrings* Items = {read=FItems, write=SetItems, nodefault};
__property bool DrawRect = {read=FDrawRect, write=SetDrawRect, default=true};
__property TFurunoRadioHighlighting Highlighting = {read=FHighlighting, write=SetHighlighting, default=0};
__property Font;
__property ParentFont;
__property TabOrder;
__property TabStop;
__property Enabled;
__property Visible;
__property OnEnter;
__property OnExit;
__property OnKeyDown ;
__property OnKeyPress ;
__property OnKeyUp ;
__property OnMouseDown ;
__property OnMouseMove ;
__property OnMouseUp ;
};
//---------------------------------------------------------------------------
#endif
 
nowaday windows uses __stdcall, not __fastcall Ion Filipski
1c.bmp


filipski@excite.com
 
try taking out either virtual or void before your __fastcall, and also. do you have the name of the handle that your virtual void __fastcall is in, (i.e., virtual void __fastcall TForm1::KeyDown(); virtual void __fastcall TForm1::MouseDown(); Cyprus
 
try taking out either virtual or void before your __fastcall, and also. do you have the name of the handle that your virtual void __fastcall is in, (i.e., virtual void __fastcall TForm1::KeyDown(); virtual void __fastcall TForm1::MouseDown(); ) or the name of your component as the case may be. im just curious. Cyprus
 
Getting rid of the virtual for MouseDown ans KeyDown works.

The call to TCustomControl::GetChildren(Proc); still generates an error so I dropped the &quot;TCustomControl::&quot; and call GetChildren(Proc) which compiles with warnings but doesn't generate an error.

The procedures are:
//---------------------------------------------------------------------------
void __fastcall TFurunoRadioGroup::KeyDown(Word &Key, TShiftState Shift)
//---------------------------------------------------------------------------
void __fastcall TFurunoRadioGroup::MouseDown(TMouseButton button, TShiftState shift, int x, int y)
//---------------------------------------------------------------------------
void __fastcall TFurunoRadioGroup::GetChildren(Classes::TGetChildProc Proc)
{
TCustomControl::GetChildren(Proc);
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top