C++Builder Programming Forum
C++Builder  |  Delphi  |  FireMonkey  |  C/C++  |  Free Pascal  |  Firebird
볼랜드포럼 BorlandForum
 경고! 게시물 작성자의 사전 허락없는 메일주소 추출행위 절대 금지
C++빌더 포럼
Q & A
FAQ
팁&트릭
강좌/문서
자료실
컴포넌트/라이브러리
메신저 프로젝트
볼랜드포럼 홈
헤드라인 뉴스
IT 뉴스
공지사항
자유게시판
해피 브레이크
공동 프로젝트
구인/구직
회원 장터
건의사항
운영진 게시판
회원 메뉴
북마크
볼랜드포럼 광고 모집

C++빌더 Q&A
C++Builder Programming Q&A
[35080] Re:[C++ Error] : E2247 에러..
방태윤 [nabty] 1385 읽음    2004-05-19 11:23
님과 제 빌더가 다른것 같은데요.수정해서라도 쓰신다면 아래와 같이 해보십시요.
아마 대부분 의견이 권장할만한 방법은 아닐겁니다...

builder\include\vcl\StdCtrls.hpp 에서 아래 내용을 찾아보십시요.
보면 제것의 경우에는
__property Types::TPoint CaretPos = {read=GetCaretPos, write=SetCaretPos}; 가
public: 밑에 있습니다.
아마 님은 CaretPos 가 다른곳에 있을겁니다.
제것처럼 자리만 옮기고 저장해서 해보십시요.
아래는 제것에서 복사한것이니 참고 하시고요...
저는 6.0 이거든요.이렇게 해서 되면 다행이고요...-.-


class DELPHICLASS TCustomMemo;
class PASCALIMPLEMENTATION TCustomMemo : public TCustomEdit
{
    typedef TCustomEdit inherited;
   
private:
    Classes::TStrings* FLines;
    Classes::TAlignment FAlignment;
    TScrollStyle FScrollBars;
    bool FWordWrap;
    bool FWantReturns;
    bool FWantTabs;
    MESSAGE void __fastcall WMGetDlgCode(Messages::TWMNoParams &Message);
    HIDESBASE MESSAGE void __fastcall WMNCDestroy(Messages::TWMNoParams &Message);
   
protected:
    virtual Types::TPoint __fastcall GetCaretPos();
    virtual void __fastcall SetCaretPos(const Types::TPoint &Value);
    virtual void __fastcall CreateParams(Controls::TCreateParams &Params);
    virtual void __fastcall CreateWindowHandle(const Controls::TCreateParams &Params);
    DYNAMIC void __fastcall KeyPress(char &Key);
    virtual void __fastcall Loaded(void);
    void __fastcall SetAlignment(Classes::TAlignment Value);
    void __fastcall SetLines(Classes::TStrings* Value);
    void __fastcall SetScrollBars(TScrollStyle Value);
    void __fastcall SetWordWrap(bool Value);
    __property Classes::TAlignment Alignment = {read=FAlignment, write=SetAlignment, default=0};
    __property TScrollStyle ScrollBars = {read=FScrollBars, write=SetScrollBars, default=0};
    __property bool WantReturns = {read=FWantReturns, write=FWantReturns, default=1};
    __property bool WantTabs = {read=FWantTabs, write=FWantTabs, default=0};
    __property bool WordWrap = {read=FWordWrap, write=SetWordWrap, default=1};
   
public:
    __fastcall virtual TCustomMemo(Classes::TComponent* AOwner);
    __fastcall virtual ~TCustomMemo(void);
    DYNAMIC Classes::TAlignment __fastcall GetControlsAlignment(void);
    __property Types::TPoint CaretPos = {read=GetCaretPos, write=SetCaretPos};
    __property Classes::TStrings* Lines = {read=FLines, write=SetLines};
public:
    #pragma option push -w-inl
    /* TWinControl.CreateParented */ inline __fastcall TCustomMemo(HWND ParentWindow) : TCustomEdit(ParentWindow) { }
    #pragma option pop
   
};


초보 님이 쓰신 글 :
: r->CaretPos=TPoint(0,y);  에서
: [C++ Error] Cess.cpp(73): E2247 'TCustomMemo::CaretPos' is not accessible
: 저만 그런가여?
:
: 방태윤 님이 쓰신 글 :
: : 초보 님이 쓰신 글 :
: : :
: : :  r->CaretPos=TPoint(0,y);  에서 에러가 나네여..
: : :
: : : 방태윤 님이 쓰신 글 :
: : : : 이걸로 해 보세요..
: : : : void change_line_color(TRichEdit*r,int y,TColor c) // y=0 이 첫줄
: : : : {
: : : :   if(y>r->Lines->Count-1)return;
: : : :   r->CaretPos=TPoint(0,y);
: : : :   r->SelLength=r->Lines->Strings[y].Length();
: : : :   r->SelAttributes->Color=c;
: : : : }
: : : :
: : : :
: : : :
: : : : 초보 님이 쓰신 글 :
: : : : : RichEdit에서 라인의 위치를 찾아 그부분만 폰트 색깔 변하게 하는 방법중에서
: : : : : 어떤 분의 답변 중에 하나를 그대로 사용해 보았습니다..
: : : : : 그런데..      
: : : : : void ChageColor(...)
: : : : : {
: : : : :       ....
: : : : :   char* s = (char*)malloc(sizeof(BYTE) *100);
: : : : :        Form1->RichEdit->Lines->Add("   --------------------");
: : : : :        Form1->RichEdit->SelAttributes->Color = clGreen;
: : : : :        wsprintf(s," 제목...Software");
: : : : :        //Form1->RichEdit->Lines->Add(s);                 // 1.
: : : : :        Form1->RichEdit->Lines->Strings[Line] = s;       // 2
: : : : :
: : : : :        Form1->RichEdit->SelAttributes->Color = clBlack;
: : : : :        Form1->RichEdit->Lines->Add("   --------------------");
: : : : :        Line = Line + 4;
: : : : :   free(s);
: : : : :        ...
: : : : : }
: : : : :
: : : : : 위와 같이 1과 같이 하면 잘동작하는데..2와 같이 하면 처음 동작시 한번만 글자가 푸른색으로 나타나고
: : : : : 다음부터는 아예 글자가 생략되는군여,,
: : : : : 왜 저런 현상이 발생하죠?
: : : : : 결과)
: : : : :    --------------------
: : : : : 제목...Software      --> 푸른색
: : : : :    --------------------
: : : : :    --------------------
: : : : :    --------------------
: : : : :    --------------------
: : : : :    --------------------
: : : : :    --------------------
: : : : :    --------------------
: : : : :
: : : : : 위 예제는 그냥 만들어 본거지만 원래는 Line의 위치를 위 함수를 호출할때 넘겨줍니다.
: : : : :

+ -

관련 글 리스트
34998 [질문]RichEdit에서 라인의 위치를 찾아 그부분만 폰트 색깔 변하게 하는 방법 초보 1502 2004/05/14
35008     Re:[질문]RichEdit에서 라인의 위치를 찾아 그부분만 폰트 색깔 변하게 하는 방법 방태윤 1340 2004/05/14
35016         Re:Re:[질문]에러가 나네여.. 초보 847 2004/05/15
35017             무슨 에러가 나는데요?(내용없음) 방태윤 861 2004/05/15
35021                 [C++ Error] : E2247 에러.. 초보 922 2004/05/15
35080                     Re:[C++ Error] : E2247 에러.. 방태윤 1385 2004/05/19
35022                     Re:[C++ Error] : E2247 에러.. 방태윤 1063 2004/05/15
Google
Copyright © 1999-2015, borlandforum.com. All right reserved.