c++ builder XE4, 10.2 Tokyo > 런타임 인수 > 자식 폼을 디버그 모드로 만들기 > 자식 폼 측에서도 런타임 인수는 보입니다.
C++ Builder XE4
Rad Studio 10.2 Tokyo Update 2 (追記: 2017/12/27)
하고 싶은 일
몰랐던 것
구현
자식 양식은 프로젝트 > 옵션 > 양식에서 "자동 생성 양식"에서 벗어나 "사용 가능한 양식"으로 둡니다.
상위 양식
Unit1.cpp
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "Unit1.h"
#include "Unit2.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm1::FormShow(TObject *Sender)
{
for(int idx=0; idx <= ParamCount(); idx++) {
String str = LowerCase(ParamStr(idx));
if (LowerCase(ParamStr(idx)) == L"/child") {
ShowMessage(L"Parent > /child");
}
}
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button1Click(TObject *Sender)
{
TchildForm *childPtr = new TchildForm(this);
childPtr->Show();
for(int loop=0; loop<5; loop++) {
String msg = IntToStr(loop);
OutputDebugString(msg.c_str());
Sleep(1000);
}
childPtr->Close();
childPtr->Free();
}
//---------------------------------------------------------------------------
어린이 양식
Unit2.cpp
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "Unit2.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TchildForm *childForm;
//---------------------------------------------------------------------------
__fastcall TchildForm::TchildForm(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TchildForm::FormShow(TObject *Sender)
{
for(int idx=0; idx <= ParamCount(); idx++) {
String str = LowerCase(ParamStr(idx));
if (LowerCase(ParamStr(idx)) == L"/child") {
ShowMessage(L"Child > /child");
}
}
}
//---------------------------------------------------------------------------
런타임 인수
/child
결과
상위 양식, 하위 양식 및 둘 다에서 런타임 인수를 인식 할 수있었습니다.
상위 양식 OnShow
자식 폼 OnShow
고려 사항
상위 양식이 런타임 인수를 읽고 하위 양식에 전달하는 방법도 취할 수 있지만 그렇게하려면 다음 중 하나가 필요합니다.
Reference
이 문제에 관하여(c++ builder XE4, 10.2 Tokyo > 런타임 인수 > 자식 폼을 디버그 모드로 만들기 > 자식 폼 측에서도 런타임 인수는 보입니다.), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://qiita.com/7of9/items/23390da53effc6a1ec01텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념 (Collection and Share based on the CC Protocol.)