자세한 답변 감사합니다..
인자를 넣어야하는 것이군요.. -o-
이정구 님이 쓰신 글 :
:
:
:
: 생성자에서 인자를 안 넣으셨네요. 그대로 하면 에러가 날 텐데요.
그리고 관용적으로 Get , Set 접두사는 함수에 붙이는데 Get 을 변수이름에 붙이셨네요.
소스가 일부만 올라온것 같아서 어떤 내용인지는 모르겠습니다만
FullScreenMode property 를 true, false 값을 가지는 것으로 하고 FullScreenSize property 를 열거형으로 하시려는 것 같습니다.
제가 만든 소스를 올립니다. 설치하면 다음과 같이 Object Inspector 에 나타납니다.
:

헤더파일
:
//---------------------------------------------------------------------------
#ifndef D2DCoreH #define D2DCoreH //--------------------------------------------------------------------------- #include #include //---------------------------------------------------------------------------
enum TFullScreenSize { fs0240, fs0480, fs0600, fs0768, fs0960, fs1024, fs1200, fs0360w, fs0720w, fs1080w, fsMaximum };
class PACKAGE TD2DCore : public TComponent { private: TFullScreenSize FFullScreenSize; //열거형의 값을 저장할 변수 void __fastcall SetFullScreenSize(TFullScreenSize fs); //쓰는 방법 bool FFullScreenMode;
protected:
public: __fastcall TD2DCore(TComponent* Owner);
__published: __property TFullScreenSize FullScreenSize = { read = FFullScreenSize, write = SetFullScreenSize, default = fs0480}; __property bool FullScreenMode = { read = FFullScreenMode, write = FFullScreenMode, default = false }; }; //--------------------------------------------------------------------------- #endif
cpp 파일
: //--------------------------------------------------------------------------- #include
#pragma hdrstop
#include "D2DCore.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(TD2DCore *) { new TD2DCore(NULL); } //--------------------------------------------------------------------------- __fastcall TD2DCore::TD2DCore(TComponent* Owner ) : TComponent(Owner) { FullScreenSize = fs0480; //초기값을 지정 FullScreenMode = true; } //---------------------------------------------------------------------------
void __fastcall TD2DCore::SetFullScreenSize(TFullScreenSize fs) { if(FFullScreenSize != fs) //새로 지정하는 값이 기존의 값과 다르면 FFullScreenSize = fs; //새로운 값으로 수정 }
namespace D2dcore { void __fastcall PACKAGE Register() { TComponentClass classes[1] = {__classid(TD2DCore)}; RegisterComponents("Samples", classes, 0); } } //---------------------------------------------------------------------------
: |