これはコンパイラエラー、ないリンカーであり、エラー。
TMouseWheelEvent
の実際の宣言をControls.hpp
に見てください。 scrollEvent()
メソッドが実際に宣言されているものと一致しない場合は、エラーが発生しません。あなたは32ビットまたは64ビット、TMouseWheelEvent
(具体的には、そのMousePos
パラメータ)用にコンパイルされているかどうかに応じて
が異なっ宣言されています。
32ビット:
typedef void __fastcall (__closure *TMouseWheelEvent)(System::TObject* Sender, System::Classes::TShiftState Shift, int WheelDelta, const System::Types::TPoint &MousePos, bool &Handled);
64ビット:
typedef void __fastcall (__closure *TMouseWheelEvent)(System::TObject* Sender, System::Classes::TShiftState Shift, int WheelDelta, System::Types::TPoint MousePos, bool &Handled);
この理由は、BCC32とBCC64は、彼らが周りに8バイトの構造体のタイプ(TPoint
など)を渡す方法が異なります。この違いは、エンバカデロのDocWikiに文書化されています。この違いによる影響を受け
Events with Structures or Sets of 5-8 Bytes Are Not Valid for BCC64
他のイベントタイプをTGetSiteInfoEvent
、TMouseWheelUpDownEvent
、そしてTContextPopupEvent
が含まれます。でもクリーナー、
class TForm1 : public TForm
{
...
void __fastcall scrollEvent(
TObject* Sender, TShiftState Shift, int WheelDelta,
#ifndef _WIN64
const TPoint &MousePos,
#else
TPoint MousePos,
#endif
bool &Handled);
...
};
...
void __fastcall TForm1::scrollEvent(TObject* Sender, TShiftState Shift, int WheelDelta,
#ifndef _WIN64
const TPoint &MousePos,
#else
TPoint MousePos,
#endif
bool &Handled)
{
...
}
または::
class TForm1 : public TForm
{
...
#ifndef _WIN64
void __fastcall scrollEvent(TObject* Sender, TShiftState Shift, int WheelDelta, const TPoint &MousePos, bool &Handled);
#else
void __fastcall scrollEvent(TObject* Sender, TShiftState Shift, int WheelDelta, TPoint MousePos, bool &Handled);
#endif
...
};
...
#ifndef _WIN64
void __fastcall TForm1::scrollEvent(TObject* Sender, TShiftState Shift, int WheelDelta, const TPoint &MousePos, bool &Handled)
#else
void __fastcall TForm1::scrollEvent(TObject* Sender, TShiftState Shift, int WheelDelta, TPoint MousePos, bool &Handled)
#endif
{
...
}
をそれとも、少しクリーナーのアプローチを:
これを修正するには、文書化#ifdef
にあなたのコードを持っています
#ifndef _WIN64
#define SAFE_5TO8_PARAM(type, name) const type &name
#else
#define SAFE_5TO8_PARAM(type, name) type name
#endif
class TForm1 : public TForm
{
...
void __fastcall scrollEvent(TObject* Sender, TShiftState Shift, int WheelDelta, SAFE_5TO8_PARAM(TPoint, MousePos), bool &Handled);
...
};
...
void __fastcall TForm1::scrollEvent(TObject* Sender, TShiftState Shift, int WheelDelta, SAFE_5TO8_PARAM(TPoint, MousePos), bool &Handled)
{
...
}
だから私が欠けていたのはちょうどconstだった(32ビット用)。 ありがとうございます! –