-
Notifications
You must be signed in to change notification settings - Fork 0
/
MainDlg.cpp
45 lines (36 loc) · 2.26 KB
/
MainDlg.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
// MainDlg.cpp : implementation of the CMainDlg class
//
/////////////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "MainDlg.h"
#include "SDocHostUIHandler.h"
//#include <helper/mybuffer.h>
CMainDlg::CMainDlg() : SHostWnd(_T("LAYOUT:XML_MAINWND"))
{
}
CMainDlg::~CMainDlg()
{
}
BOOL CMainDlg::OnInitDialog( HWND hWnd, LPARAM lParam )
{
SIECtrl *pIECtrl = FindChildByName2<SIECtrl>(L"iectrl_demo");
wchar_t szPath[MAX_PATH];
GetModuleFileNameW(NULL,szPath,MAX_PATH);
SStringW strUrl = SStringW(L"res://") + szPath + L"/test.htm";
pIECtrl->GetIEObject()->Navigate(bstr_t(strUrl),NULL,NULL,NULL,NULL);
return 0;
}
void CMainDlg::OnBtnCallJS()
{
SIECtrl *pIECtrl = FindChildByName2<SIECtrl>(L"iectrl_demo");
SArray<SStringW> params;
params.Add(L"param1");
ExecuteScript(pIECtrl->GetIEObject(),L"Test",params);
}
void CMainDlg::OnCreateIE(EventArgs *e)
{
EventSwndCreate * e2 = sobj_cast<EventSwndCreate>(e);
SASSERT(e2);
SIECtrl *pIECtrl = sobj_cast<SIECtrl>(e->Sender());
//pIECtrl->SetScriptCaller(this);
}