Microsoft MVP성태의 닷넷 이야기
오류 유형 : 85. DEP 비호환 ActiveX 오류 [링크 복사], [링크+제목 복사],
조회: 30123
글쓴 사람
정성태 (techsharer at outlook.com)
홈페이지
첨부 파일
 
(연관된 글이 3개 있습니다.)
DEP 비호환 ActiveX 오류


DEP가 간혹 문제가 되고 있습니다. 예전에도 DEP 활성화된 시스템에서 이에 호환되지 않는 ActiveX를 사용할 때 오류나는 경우를 한번 소개해 드렸지요.

Windowless ActiveX controls are not supported 
; https://www.sysnet.pe.kr/2/0/582

근데, DEP 문제로 인한 ActiveX 활성화 오류가 꼭 위와 같지는 않더군요.
예를 들어, 제가 최근에 다뤘던 어떤 구형 ActiveX는 실행시에 다음과 같이 오류가 발생했습니다.

[그림 1: DEP 로 인한 ActiveX 활성 오류]
dep_ax_activation_error_1.png

이번에도 역시 "((System.ComponentModel.ISupportInitialize)(this.axXObject1)).EndInit();" 에서 오류가 발생하긴 했는데, 이번엔 메시지가 다릅니다.

System.InvalidOperationException was unhandled
  Message="Cross-thread operation not valid: Control 'axFBPlayer1' accessed from a thread other than the thread it was created on."
  Source="System.Windows.Forms"
  StackTrace:
       at System.Windows.Forms.Control.get_Handle()
       at System.Windows.Forms.Control.SetParentHandle(IntPtr value)
       at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
       at System.Windows.Forms.AxHost.EndInit()
       at WindowsFormsApplication1.Form1.InitializeComponent()
       at WindowsFormsApplication1.Form1..ctor()
       at WindowsFormsApplication1.Program.Main()
  InnerException: 

어쨌든, 이런 경우에 봐야 할 것은 DEP 해결인데, NXCOMPAT 옵션을 명시적으로 해제하는 방법이 C# 프로젝트 설정창에는 제공되지 않기 때문에 별도의 빌드 이벤트를 구성하는 것으로 우회해서 처리할 수 있습니다. (DEP는 EXE 프로세스 수준에서 적용되는 것이기 때문에 ActiveX 오류일지라도 EXE 에서 NXCOMPAT를 수정해 주면 됩니다.)

우회 방법은 아래의 글에서 잘 설명해 주고 있습니다.

NXCOMPAT and the C# compiler 
; https://learn.microsoft.com/en-us/archive/blogs/ed_maurer/nxcompat-and-the-c-compiler

그래서, 다음과 같은 빌드 이벤트 구성이면 된다는!

call "$(DevEnvDir)..\tools\vsvars32.bat"
editbin.exe /NXCOMPAT:NO "$(TargetPath)"



[이 토픽에 대해서 여러분들과 의견을 공유하고 싶습니다. 틀리거나 미흡한 부분 또는 의문 사항이 있으시면 언제든 댓글 남겨주십시오.]

[연관 글]






[최초 등록일: ]
[최종 수정일: 12/20/2022]

Creative Commons License
이 저작물은 크리에이티브 커먼즈 코리아 저작자표시-비영리-변경금지 2.0 대한민국 라이센스에 따라 이용하실 수 있습니다.
by SeongTae Jeong, mailto:techsharer at outlook.com

비밀번호

댓글 작성자
 




... 166  167  168  169  170  171  172  [173]  174  175  176  177  178  179  180  ...
NoWriterDateCnt.TitleFile(s)
675정성태3/14/200925160오류 유형: 70. Virtual Machine Additions 제거
673정성태3/11/200923801웹: 10. 금일 진행되었던 마이크로소프트 IE 8 행사의 ActiveX 세션 PPT [6]파일 다운로드1
672정성태3/1/200936724Windows: 43. Loopback network adapter 설치하기 [2]
670정성태2/22/200929914.NET Framework: 124. IIS 7에서 SVC 호스팅 [1]
669정성태2/21/200924438오류 유형: 69. The SQL Server Network Interface library could not register the Service Principal Name (SPN) for the SQL Server service.
668정성태2/21/200929415개발 환경 구성: 35. SQL Express 버전과 User Instance 옵션
667정성태2/14/200941295웹: 9. IE 7. IWebBrowser2 인터페이스 메서드의 Navigate / Navigate2 차이점 [3]파일 다운로드1
666정성태2/12/200927139웹: 8. IE 8: 프로세스와 윈도우의 관계 - LCIE [1]파일 다운로드1
665정성태2/7/200924037웹: 7. Internet Explorer 8 - XHR, XDR, XST, XSRF [1]
664정성태2/5/200920089Windows: 42. Concurrency Runtime
663정성태2/5/200924793.NET Framework: 123. WPF - Arial Narrow 폰트 문제
662정성태2/3/200920520VS.NET IDE: 59. HyperAddin 도구 사용 설명 [1]
661정성태2/3/200924198오류 유형: 68. msxml6r.dll 설치 오류
660정성태2/3/200922769Windows: 41. UAC 보안 취약 [2]
659정성태2/2/200934115오류 유형: 67. ClickOnce 응용 프로그램이 실행되지 않을 때.
658정성태2/1/200926167Team Foundation Server: 30. 소스 서버 보안
657정성태2/1/200929058Windows: 40. Q1 Ultra + Windows 7 베타
656정성태2/1/200930580디버깅 기술: 24. .NET JIT 최적화 코드 생성 제어
655정성태1/31/200926873Windows: 39. IE8 표준 모드 [4]
653정성태1/29/200921827.NET Framework: 122. XML Serializer를 이용한 값 복사: 성능은 어떨까!파일 다운로드1
652정성태1/22/200922593.NET Framework: 121. WPF - PrintTicket provider failed to bind to printer.
651정성태1/20/200919816.NET Framework: 120. 타입이 다른 배열끼리의 변환
650정성태1/19/200931618COM 개체 관련: 21. C/C++ 프로젝트에 /clr 옵션 적용으로 인한 COM 개체 사용 오류
649정성태1/18/200929174Windows: 38. Q1U UMPC에 Windows 7 베타 설치하기
648정성태1/18/200927904Windows: 37. Windows PE를 USB 메모리에 적용
647정성태1/18/200938043Windows: 36. Windows PE ISO 이미지 만들기 [1]
... 166  167  168  169  170  171  172  [173]  174  175  176  177  178  179  180  ...