|
// *********************************************************
// コンストラクタ
// *********************************************************
LboxIEControl::LboxIEControl( HWND hOwner )
{
this->pIEControl = NULL;
AtlAxWinInit();
this->hWnd = CreateWindowEx(
WS_EX_CLIENTEDGE,
"AtlAxWin",
"about:blank",
WS_CHILD | WS_VISIBLE
| WS_BORDER | WS_HSCROLL | WS_VSCROLL,
0, 0, 200, 200,
hOwner,
NULL,
LboxGetInstance( hOwner ),
NULL
);
if ( this->hWnd != NULL ) {
if (
AtlAxGetControl(
this->hWnd, (IUnknown**)&(this->pIEControl)
) != S_OK ) {
this->pIEControl = NULL;
}
}
}
LboxIEControl::LboxIEControl()
{
this->pIEControl = NULL;
this->hWnd = NULL;
}
// *********************************************************
// デストラクタ
// *********************************************************
LboxIEControl::~LboxIEControl()
{
if ( this->pIEControl != NULL ) {
SHDocVw::IWebBrowser2Ptr pIE;
pIE.operator = (
(SHDocVw::IWebBrowser2Ptr *)&(this->pIEControl)
);
pIE.Release();
this->pIEControl = NULL;
}
if ( this->hWnd != NULL ) {
DestroyWindow( this->hWnd );
this->hWnd = NULL;
}
LboxInfo Info;
LboxString Buff;
LboxString Path;
LboxString DelPath;
LboxTool Tool;
if ( !(Info.TempPath( &Buff ) ) ) {
Tool.ProgramDirectory( &Buff );
}
Buff.AddBackslash();
Path.operator = (&Buff);
Buff.operator += ("LIC*.tmp");
HANDLE hFile;
BOOL bRet;
WIN32_FIND_DATA wfd;
hFile = FindFirstFile( Buff.szLboxString, &wfd );
bRet = true;
int nLoop;
nLoop = 0;
while( hFile != INVALID_HANDLE_VALUE && bRet == (BOOL)true ) {
nLoop++;
if ( nLoop > 1000 ) {
break;
}
DelPath.operator = (&Path);
DelPath.operator += (wfd.cFileName );
DeleteFile( DelPath.szLboxString );
bRet = FindNextFile( hFile, &wfd );
}
if ( !bRet ) {
FindClose( hFile );
}
}
| |