|
답변 고맙습니다. 쓴 글이 한단계를 넘어서 다시 쓰는데요.
생성자 함수를 넣지 않았다고 했는데요.
__fastcall commatext::commatext(TComponent* Owner)
: TCustomMemo(Owner)
{
}
이부분에 코드를 안넣었다는 이야기 인가요?
안넣어도 되지 않나요?
아..우매해서 모르겠네요..도와주세요.^^
--------------------------------------------------------------------------------
유엔아이 현입니다.
생성자를 CPP 에 정의 하지 얺으셨군요~
그럼
모라 님이 쓰신 글 :
: 안녕하세요 볼랜드 c++빌더 4 빌더정복의 '컴포넌트 만들기'를 하고 있는데요.(예제에 있는데로..)
:
:
: __fastcall commatext 부분에 에러가 나네요 선언에 대한 에러문제던데
:
: 당최 감을 못잡겠군요, 도움을 바랍니다 :)
:
: 아 참고로 이 콤포넌트는 '우측정렬,오로지 숫자만 인식하고 콤마'를 넣어주는 콤포넌트랍니다.
:
: commatext 헤더부분
:
: //---------------------------------------------------------------------------
:
: #ifndef commatextH
: #define commatextH
: //---------------------------------------------------------------------------
: #include <SysUtils.hpp>
: #include <Controls.hpp>
: #include <Classes.hpp>
: #include <Forms.hpp>
: #include <StdCtrls.hpp>
: //---------------------------------------------------------------------------
: class PACKAGE commatext : public TCustomMemo
: {
: private:
: double FieldValue;
: void __fastcall SetFieldValue(double A);
: void __fastcall FormatNum();
:
: protected:
: public:
: __fastcall commatext(TComponent* Owner);
:
: __published:
: __property Text ;
: __property double Value ={read =FieldValue, write = SetFieldValue, default=1);
: __property Align ;
: __property BorderStyle ;
: __property Color ;
: __property DragCursor ;
: __property DragMode ;
: __property Enabled ;
: __property Font ;
: __property HideSelection ;
: __property MaxLength ;
: __property ParentColor ;
: __property ParentFont ;
: __property ParentShowHint ;
: __property PopupMenu ;
: __property ReadOnly ;
: __property ScrollBars ;
: __property ShowHint ;
: __property TabOrder ;
: __property TabStop ;
: __property Visible ;
: __property OnChange ;
: __property OnClick ;
: __property OnDblClick ;
: __property OnDragDrop ;
: __property OnDragOver ;
: __property OnEndDrag ;
: __property OnEnter ;
: __property OnExit ;
: __property OnKeyDown ;
: __property OnKeyPress ;
: __property OnKeyUp ;
: __property OnMouseDown ;
: __property OnMouseUp ;
: __property OnStartDrag ;
:
:
: };
: //---------------------------------------------------------------------------
: #endif
:
:
:
:
: commatext cpp 부분..
: //---------------------------------------------------------------------------
:
: #include <vcl.h>
: #pragma hdrstop
:
: #include "commatext.h"
: #pragma package(smart_init)
: //---------------------------------------------------------------------------
: // ValidCtrCheck is used to assure that the components created do not have
: // any pure virtual functions.
: //
:
: static inline void ValidCtrCheck(commatext *)
: {
: new commatext(NULL);
: }
: //---------------------------------------------------------------------------
: __fastcall commatext::commatext(TComponent* Owner)
: : TCustomMemo(Owner)
: {
:
: }
: //---------------------------------------------------------------------------
: namespace Commatext
: {
: void __fastcall PACKAGE Register()
: {
: TComponentClass classes[1] = {__classid(commatext)};
: RegisterComponents("Samples", classes, 0);
: }
: }
: //---------------------------------------------------------------------------
: void __fastcall commatext::SetFieldValue(double A)
: {
: FieldValue = A;
: FormatNum();
: return;
: }
: //---------------------------------------------------------------------------
: void __fastcall commatext:FormatNum()
: {
: Text = FormatFloat("#,##0",FieldValue);
: return;
: }
: //---------------------------------------------------------------------------
|