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
[44068] Re:Re:객체를 함수로 넘겨서 생성한다음 다시 쓸려고 하는데..어떻게 하면 좋을지요..
둥이네 [grin79] 797 읽음    2006-03-11 09:20
^^ 감사합니다. ^^; 이렇게 하면 되는군요..

0 님이 쓰신 글 :
: 둥이네 님이 쓰신 글 :
: : void __fastcall TForm1::FFPanel9MouseMove(TObject *Sender,
: :       TShiftState Shift, int X, int Y)
: : {           
: :               //............................
: :               POINT pPos ;
: :                 pPos.x  = X;
: :                 pPos.y = Y;
: :                 GetCursorPos(&pPos);
: :
: :                 if (FindControl(WindowFromPoint(pPos)) == NULL)
: :                         return ;
: :                 TFFPanel *PanTest =  (TFFPanel *)FindControl(WindowFromPoint(pPos));
: :              
: :                                           if( PanTest->Tag>0 ){
: :                         RxSpeedButton->Left =  PanTest->Left-2;
: :                         RxSpeedButton->Top = PanTest->Top-2;
: :                         xPoint = X;
: :                         yPoint = Y;
: :                  //.....................
: :                 }
: :
: :
: : 이렇게 된 부분을.... 중간에..TFFPanel *PanTest =  (TFFPanel *)FindControl(WindowFromPoint(pPos));
: : 윕부분까지를 따로 함수를 만들어서 빼낼려고 합니다.
: : 이부분이 중복 되는 구간이 많아서 따로 뺄려고 하거등요..
: :
: :
: : void __fastcall TForm1::FFPanel9MouseMove(TObject *Sender,
: :       TShiftState Shift, int X, int Y)
: : {
: :               // ..........................
: :                TFFPanel *PanTest;
: :                 FindPanel(*PanTest,X, Y);
: :                  if( PanTest->Tag>0 ){
: :                         RxSpeedButton->Left =  PanTest->Left-2;
: :                         RxSpeedButton->Top = PanTest->Top-2;
: :                         xPoint = X;
: :                         yPoint = Y;
: :
: :
: :
: :              //...........................
: : }
: :
: : void __fastcall TForm1::FindPanel(TFFPanel &PanTest,int X,int Y){
: :                 POINT pPos ;
: :                 pPos.x  = X;
: :                 pPos.y = Y;
: :                 GetCursorPos(&pPos);
: :
: :                 if (FindControl(WindowFromPoint(pPos)) == NULL)
: :                         return ;
: :
: :                 PanTest =(TFFPanel *)FindControl(WindowFromPoint(pPos));
: :                // Edit1->Text =  PanTest->Tag ;
: : }
: :
: : 이렇게 했는데..자꾸.. PanTest =(TFFPanel *)FindControl(WindowFromPoint(pPos));
: : 이 부분에서 에러가 나네요...
: : 함수를 어떻게 바꾸면 좋을지 몰라서 조언 부탁 드립니다. 아니면 처음부터 잘못 작성한건지..
: : 어떻게 해야 할지..조언 부탁 드립니다.
:
:
: void __fastcall TForm1::FFPanel9MouseMove(TObject *Sender,
:       TShiftState Shift, int X, int Y)
: {
:               // ..........................
:                TFFPanel *PanTest;
:                 FindPanel(&PanTest,X, Y);
:                  if( PanTest->Tag>0 ){
:                         RxSpeedButton->Left =  PanTest->Left-2;
:                         RxSpeedButton->Top = PanTest->Top-2;
:                         xPoint = X;
:                         yPoint = Y;
:              //...........................
: }
:
: void __fastcall TForm1::FindPanel(TFFPanel **PanTest,int X,int Y){
:                 POINT pPos ;
:                 pPos.x  = X;
:                 pPos.y = Y;
:                 GetCursorPos(&pPos);
:
:                // if (FindControl(WindowFromPoint(pPos)) == NULL)  return ;
:
:                 *PanTest =(TFFPanel *)FindControl(WindowFromPoint(pPos));
:                // Edit1->Text =  PanTest->Tag ;
: }
:
:
: OR
:
: void __fastcall TForm1::FFPanel9MouseMove(TObject *Sender,
:       TShiftState Shift, int X, int Y)
: {
:               // ..........................
:                TFFPanel *PanTest = FindPanel(X, Y);
:                  if( PanTest->Tag>0 ){
:                         RxSpeedButton->Left =  PanTest->Left-2;
:                         RxSpeedButton->Top = PanTest->Top-2;
:                         xPoint = X;
:                         yPoint = Y;
:              //...........................
: }
:
: TFFPanel * __fastcall TForm1::FindPanel(int X,int Y){
:                 POINT pPos ;
:                 pPos.x  = X;
:                 pPos.y = Y;
:                 GetCursorPos(&pPos);
:
:               //  if (FindControl(WindowFromPoint(pPos)) == NULL)  return;
:
:                 return (TFFPanel *)FindControl(WindowFromPoint(pPos));
:                // Edit1->Text =  PanTest->Tag ;
: }

+ -

관련 글 리스트
44017 객체를 함수로 넘겨서 생성한다음 다시 쓸려고 하는데..어떻게 하면 좋을지요.. 둥이네 849 2006/03/09
44054     Re:객체를 함수로 넘겨서 생성한다음 다시 쓸려고 하는데..어떻게 하면 좋을지요.. 0 899 2006/03/10
44068         Re:Re:객체를 함수로 넘겨서 생성한다음 다시 쓸려고 하는데..어떻게 하면 좋을지요.. 둥이네 797 2006/03/11
44023     Re:객체를 함수로 넘겨서 생성한다음 다시 쓸려고 하는데..어떻게 하면 좋을지요.. WARSHIP 878 2006/03/09
44024         Re:Re:객체를 함수로 넘겨서 생성한다음 다시 쓸려고 하는데..어떻게 하면 좋을지요.. 둥이네 900 2006/03/09
Google
Copyright © 1999-2015, borlandforum.com. All right reserved.