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
[181] [질문] BCB - 레지스트리의 읽기와 저장에 대하여.../프포
dreamsys [ ] 7105 읽음    1998-03-01 12:05
안녕하세요.
C++빌더에서 레지스트리에다 저장하고 읽어들일라고 하는데,...
자꾸 에러 메세지가 나오더군요.
아래는 제가 짠 코드입니다.
코드가 이상있으면 고쳐주셨으면 합니다.
꼭 좀 부탁드립니다.


void __fastcall TMainForm::FormClose(TObject *Sender, TCloseAction &Action)
{
Registry->WriteInteger("Left", Left);
Registry->WriteInteger("Top", Top);
Registry->WriteInteger("Height", Height);
Registry->WriteInteger("Width", Width);
Registry->WriteString("Color",RichEdit1->Color);
Registry->WriteString("ColorFont", RichEdit1->Font->Color);
Registry->WriteString("WindowState", WindowState);
Registry->Free();
}
//---------------------------------------------------------------------------
void __fastcall TMainForm::FormShow(TObject *Sender)
{
    int iLeft, iTop, iHeight, iWidth;
    String iColor, iColorFont, iWinState;

    Registry = new TRegistry;
    Registry->RootKey = HKEY_LOCAL_MACHINE;
    Registry->OpenKey("SOFTWARE\\MySoft", TRUE);

    try
    {
        iLeft      = Registry->ReadInteger("Left");
        iTop       = Registry->ReadInteger("Top");
        iHeight    = Registry->ReadInteger("Height");
        iWidth     = Registry->ReadInteger("Width");
        iColor     = Registry->ReadString("Color");
        iColorFont = Registry->ReadString("ColorFont");
        iWinState  = Registry->ReadString("WindowState");

        switch(iWinState)
        {
                case wsMinimized : WindowState = wsMaximized; break;
            case wsNormal : WindowState = wsNormal;
                                                Left = iLeft;
                                                Top = iTop;
                                                Height = iHeight - 5;
                                                Width = iWidth - 5;
                                                        break;
            case wsMaximized : WindowState = wsMaximized; break;
        }
                RichEdit1->Color = iColor;
        RichEdit1->Font->Color = iColorFont;
    }
    catch (...)
    {
    }
}
//---------------------------------------------------------------------------


+ -

관련 글 리스트
181 [질문] BCB - 레지스트리의 읽기와 저장에 대하여.../프포 dreamsys 7105 1998/03/01
182     [답변] DREAMSYS/ BCB - 레지스트리의 읽기와 저장에 대/프포 드림빌더 6902 1998/03/01
Google
Copyright © 1999-2015, borlandforum.com. All right reserved.