Delphi/C++ Builder Starter Edition의 VCL에서 WebBrowser 구성 요소 사용
7084 단어 델파이C++빌더programmingVCL
소개
이것은 Delphi Advent Calendar 2017 기사 ... 아닙니다. 오늘 행해진.
이 기사는 Delphi/C++ Builder Starter Edition의 VCL에서 WebBrowser 구성 요소를 사용하는 기사입니다.
방법
우선, 퍼스널리티를 Delphi/C++Builder 의 어느 쪽인가에 둘 필요가 있습니다. 확실하지 않은 경우 파일 | 새로 만들기 | VCL 양식 응용 프로그램에서 Delphi 또는 C++ Builder 빈 프로젝트를 열어 두십시오.
Delphi 또는 C++Builder 중 하나만 설치한 경우 IDE를 시작하기만 하면 됩니다.
Delphi의 경우
구성 요소 | 구성 요소 가져 오기에서 ActiveX 컨트롤 가져 오기를 선택하고 다음 (N) >> 버튼을 누릅니다.
찻차 등 D 미 x와 거
목록에서 Microsoft Internet Controls를 찾아 선택하고 다음(N) >> 버튼을 누릅니다.

이대로 [다음 (N) >>] 버튼을 누릅니다.

새 패키지에 설치를 체크하고 [다음 (N) >>] 버튼을 누릅니다.

패키지는 UAC의 영향을 받지 않는 곳에 보관한다.

다음과 같이 입력하고 마침 버튼을 누릅니다.
품목
내용
패키지 이름
(모든 폴더)\WebBrowser.dpk
설명
WebBrowser Component
이러한 경고가 나오므로 [예]를 누릅니다.

구성 요소가 설치됩니다.

설치된 구성 요소는 도구 팔레트의 ActiveX 탭에 저장됩니다.

설치 직후에는 ActiveX 탭이 보이지 않을지도 모른다. 그런 때에는 당황하지 않고 시끄럽지 않고 IDE를 재기동해 보자.
C++Builder의 경우
구성 요소 | 구성 요소 가져 오기에서 ActiveX 컨트롤 가져 오기를 선택하고 다음 (N) >> 버튼을 누릅니다.

목록에서 Microsoft Internet Controls를 찾아 선택하고 다음(N) >> 버튼을 누릅니다.

WebBrowser 클래스 이름을 TCppWebBrowser로 변경합니다.

변경이 끝나면 [OK] 버튼을 누르고 원래 대화 상자의 [다음 (N) >>] 버튼을 누릅니다.

패키지는 UAC의 영향을 받지 않는 곳에 보관한다.

다음과 같이 입력하고 마침 버튼을 누릅니다.
품목
내용
패키지 이름
(모든 폴더)\WebBrowserCpp.cbproj
설명
WebBrowser Component (C++)
이러한 경고가 나오므로 [예]를 누릅니다.

구성 요소가 설치됩니다.

설치된 구성 요소는 도구 팔레트의 ActiveX 탭에 저장됩니다.

설치 직후에는 ActiveX 탭이 보이지 않을지도 모른다. 그런 때에는 당황하지 않고 시끄럽지 않고 IDE를 재기동해 보자.
검증
이러한 양식을 만들고 버튼 이벤트 핸들러에,

procedure TForm1.Button1Click(Sender: TObject);
begin
WebBrowser1.Navigate('http://embarcadero.com');
end;
또는
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
Variant URL = "http://embarcadero.com";
CppWebBrowser1->Navigate(URL);
}
이러한 코드로 웹 페이지를 볼 수 있습니다.

결론
런타임에 화려하게 스크립트 오류가 발생하는 것은 기본적으로 IE 구성 요소가 이전 버전에서 실행되기 때문입니다. IE 렌더링 호환성을 위해 레지스트리를 만져보십시오.
See Also:
우선, 퍼스널리티를 Delphi/C++Builder 의 어느 쪽인가에 둘 필요가 있습니다. 확실하지 않은 경우 파일 | 새로 만들기 | VCL 양식 응용 프로그램에서 Delphi 또는 C++ Builder 빈 프로젝트를 열어 두십시오.
Delphi 또는 C++Builder 중 하나만 설치한 경우 IDE를 시작하기만 하면 됩니다.
Delphi의 경우
구성 요소 | 구성 요소 가져 오기에서 ActiveX 컨트롤 가져 오기를 선택하고 다음 (N) >> 버튼을 누릅니다.
찻차 등 D 미 x와 거
목록에서 Microsoft Internet Controls를 찾아 선택하고 다음(N) >> 버튼을 누릅니다.

이대로 [다음 (N) >>] 버튼을 누릅니다.

새 패키지에 설치를 체크하고 [다음 (N) >>] 버튼을 누릅니다.

패키지는 UAC의 영향을 받지 않는 곳에 보관한다.

다음과 같이 입력하고 마침 버튼을 누릅니다.
품목
내용
패키지 이름
(모든 폴더)\WebBrowser.dpk
설명
WebBrowser Component
이러한 경고가 나오므로 [예]를 누릅니다.

구성 요소가 설치됩니다.

설치된 구성 요소는 도구 팔레트의 ActiveX 탭에 저장됩니다.

설치 직후에는 ActiveX 탭이 보이지 않을지도 모른다. 그런 때에는 당황하지 않고 시끄럽지 않고 IDE를 재기동해 보자.
C++Builder의 경우
구성 요소 | 구성 요소 가져 오기에서 ActiveX 컨트롤 가져 오기를 선택하고 다음 (N) >> 버튼을 누릅니다.

목록에서 Microsoft Internet Controls를 찾아 선택하고 다음(N) >> 버튼을 누릅니다.

WebBrowser 클래스 이름을 TCppWebBrowser로 변경합니다.

변경이 끝나면 [OK] 버튼을 누르고 원래 대화 상자의 [다음 (N) >>] 버튼을 누릅니다.

패키지는 UAC의 영향을 받지 않는 곳에 보관한다.

다음과 같이 입력하고 마침 버튼을 누릅니다.
품목
내용
패키지 이름
(모든 폴더)\WebBrowserCpp.cbproj
설명
WebBrowser Component (C++)
이러한 경고가 나오므로 [예]를 누릅니다.

구성 요소가 설치됩니다.

설치된 구성 요소는 도구 팔레트의 ActiveX 탭에 저장됩니다.

설치 직후에는 ActiveX 탭이 보이지 않을지도 모른다. 그런 때에는 당황하지 않고 시끄럽지 않고 IDE를 재기동해 보자.
검증
이러한 양식을 만들고 버튼 이벤트 핸들러에,

procedure TForm1.Button1Click(Sender: TObject);
begin
WebBrowser1.Navigate('http://embarcadero.com');
end;
또는
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
Variant URL = "http://embarcadero.com";
CppWebBrowser1->Navigate(URL);
}
이러한 코드로 웹 페이지를 볼 수 있습니다.

결론
런타임에 화려하게 스크립트 오류가 발생하는 것은 기본적으로 IE 구성 요소가 이전 버전에서 실행되기 때문입니다. IE 렌더링 호환성을 위해 레지스트리를 만져보십시오.
See Also:

Reference
이 문제에 관하여(Delphi/C++ Builder Starter Edition의 VCL에서 WebBrowser 구성 요소 사용), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://qiita.com/ht_deko/items/c69902d644ea03f61deb텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념
(Collection and Share based on the CC Protocol.)