별로 ^^; 특별한 팁은 아니지만,,, 그래도 하나의 "아이디어" 라고 할만한 것이기에 소개합니다.
그러니까, 문제는 스마트 클라이언트의 "이벤트" 발생이 기본적인 "Internet_Zone" 에 위배되기 때문에 어쩔 수 없이 클라이언트 측에 보안설정을 강요받게 되는 데요.
만약, 순전히 이벤트로 인한 보안설정만 필요한 경우라면 다음의 팁으로 해결하시는 것을 권해 드립니다.
모든 상황에서 쓸 수 있는 방법은 아니지만, 적절하게 쓸 수 있는 상황도 있을 것 같기 때문에. ^^
소스 출처 : http://msdn.microsoft.com/msdnmag/issues/04/10/WebQA/default.aspx
Q We are considering hosting a Windows Forms control in an Internet Explorer Web browser for an intranet Web application. In order to avoid the issue of passing managed events from the Windows Forms control back to unmanaged JScript® code (we may not be able to ask all of our users to make the security changes necessary to allow this), I am thinking of having the JScript code poll the Windows Forms control (maybe four times per second) inquiring, basically, whether any events have fired that the JScript code needs to know about. In rough form, the JScript would look something like this:
window.setInterval(checkWinformEvents, 250);
var bCheckingEvents;
function checkWinformEvents() {
if(!bCheckingEvents) {
bCheckingEvents = true;
var sEvents = objWinform.AnyEventsToReport();
bCheckingEvents = false;
if (sEvents) handleWinformEvents(sEvents) ;
}
}
The managed method, AnyEventsToReport, would then return something like "Double-click on line 14 of List view," and so on. Is it a good idea to check Windows Forms events from JScript?
A Having the JScript code poll the Windows Forms control seems a little weird, but it would give you a workaround for the security restrictions put in place by Internet Explorer. There are a few problems with the code snippet, but nothing that is insurmountable. For instance, where exactly do you make the second call to setInterval? No loop is evident.
The bottom line is that this program is really not robust in the face of exceptions. Plus, there's some uninitialized data in there and you treat a string as a bool, which is a bad idea. Also, why are you doing a re-entrancy check on a method which is not recursive?
You should probably write it like this instead:
window.setInterval(checkWinformEvents, 250) ;
function checkWinformEvents()
{
try
{
handleWinformEvents(winform.AnyEventsToReport());
}
finally
{
window.setInterval(checkWinformEvents, 250) ;
}
}
[Editor's Update - 12/6/2004: setInterval evaluates an expression each time a specified number of milliseconds has elapsed and until the timer is removed with the clearInterval method. As such, it does not need to be called again every time the checkWinformEvents function is invoked.]
No | Writer | Date | Cnt. | Title | File(s) |
43 | 정성태 | 7/17/2003 | 5746 | 탐색기 Namespace Extension 컨테이너 (VC 6.0, ATL) 2002.03.24 | 1 |
42 | 정성태 | 7/17/2003 | 4275 | KBManager WebBand (VC 6.0, ATL/Script) 2001.10.01 | 1 |
41 | 정성태 | 7/17/2003 | 4343 | UrlMonDownload (VC 6.0, ATL) 2001.06.16 | 1 |
40 | 정성태 | 7/17/2003 | 4289 | IE 북마크 임포트 (VC 6.0, ATL, MFC 지원) 2001.01.20 | 1 |
39 | 정성태 | 7/17/2003 | 4859 | MsIE.exe (VC 6.0, ATL, HTML Parser 로서의 IHTMLDocument2 이용 및 IE 보안설정) 2000.11.23 | 1 |
38 | 정성태 | 7/17/2003 | 4556 | EnumIE.exe (VC 6.0, ATL, 현재 사용 중인 IE에 접속) 2000.10.24 | 1 |
37 | 정성태 | 7/17/2003 | 4314 | ReuseIE.exe (VC ++ 6,0, Internet Explorer 재사용) 2000.04.17 | 1 |
36 | 정성태 | 7/17/2003 | 3923 | RemoteViewer dll (VC ++ 6.0, ATL) 2000.03.13 | 1 |
35 | 정성태 | 7/17/2003 | 4225 | IESpy dll (VC ++ 6.0, ATL) 2000.02.28 | 1 |
34 | 정성태 | 7/17/2003 | 3961 | Bmp2Gif 콘트롤 (VC ++ 6.0, MFC) 2000.02.28 | 1 |
33 | 정성태 | 7/17/2003 | 3778 | Gif89a 콘트롤 (VC ++ 6.0, ATL) 2000.02.28 | 1 |
32 | 정성태 | 7/17/2003 | 4285 | 이미지 4버튼 (VC ++ 6.0, ATL) 2000.02.28 | 1 |
31 | 정성태 | 7/17/2003 | 3906 | 이미지 홀더 (VC ++ 6.0, ATL) 2000.02.28 | 1 |
30 | 정성태 | 7/17/2003 | 4033 | 이미지 뷰어 (VC ++ 6.0, ATL) 2000.02.28 | 1 |
29 | 정성태 | 7/17/2003 | 3812 | ChatClient (VC ++ 6.0, MFC) 1999.09.09 | 1 |
28 | 정성태 | 7/17/2003 | 5210 | Winsock2 SPI : LSP 예제 (VC ++ 6.0) 2001.08.07 | 1 |
27 | 정성태 | 7/17/2003 | 4316 | Echo Services Server (VC ++ 6.0, ATL Service) 2001.01.07 | 1 |
26 | 정성태 | 7/17/2003 | 7343 | FTP Client (VC ++ 6.0, MFC) 1999.09.14 | 1 |
25 | 정성태 | 7/17/2003 | 3710 | 모뎀 정보를 알아내는 클래스 (VC ++ 6.0, MFC) 1999.09.12 | 1 |
24 | 정성태 | 7/17/2003 | 8436 | Ping (VC ++ 6.0, MFC, CSocket Class) 1999.09.09 [1] | 1 |
23 | 정성태 | 7/21/2003 | 7401 | ChatServer / ChatClient (VC ++ 6.0, MFC, Win32 API Socket) 1999.08.01 | 2 |
22 | 정성태 | 7/17/2003 | 3873 | 성능 객체 카운터 (VC 6.0, Win32) 2001.07.07 | 1 |
21 | 정성태 | 7/17/2003 | 3898 | StringSplit 클래스 (VC++6.0, Win32) 2000.02.28 | 1 |
20 | 정성태 | 7/17/2003 | 4160 | SQLDirect 클래스 (VC++6.0, Win32) 2000.02.28 | 1 |
19 | 정성태 | 7/17/2003 | 3564 | ImeControl 클래스 (VC++6.0, Win32) 2000.02.28 | 1 |
18 | 정성태 | 7/17/2003 | 3994 | RegistryEx 클래스 (VC++6.0, Win32) 2000.02.28 | 1 |