home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DOS/V Power Report 2001 July
/
VPR0107B.BIN
/
DRIVER
/
CANOPUS
/
MVR32
/
mvr32.exe
/
data1.cab
/
Development_Kit
/
Vc
/
Samples
/
MvrCtrl
/
MvrCtrl.cpp
< prev
next >
Wrap
C/C++ Source or Header
|
2001-02-09
|
4KB
|
123 lines
//======================================================================
// -- MvrCtrl.cpp --
//
// MVR-D2000
// ActiveX サンプルプログラム
// ActiveX sample program
//
// Copyright (C) 2000 Canopus Co., Ltd. All rights reserved.
//======================================================================
//
// -- サンプルプログラムをご使用になる前に ---
// -- Before use this sample program... --
//
// このサンプルプログラムは、カノープス製品を使うためにご使用ください。
// Please use this sample progeam to use products of canopus.
//
//======================================================================
// MvrCtrl.cpp : CMvrCtrlApp クラスのインプリメンテーションおよび DLL の登録を行います。
#include "stdafx.h"
#include "MvrCtrl.h"
#include "cathelp.h" // Microsoft sampleより
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
CMvrCtrlApp NEAR theApp;
const GUID CDECL BASED_CODE _tlid =
{ 0x6d3f3522, 0xe4e0, 0x11d3, { 0xa0, 0x5e, 0, 0xa0, 0xc9, 0xaf, 0xee, 0x48 } };
const WORD _wVerMajor = 1;
const WORD _wVerMinor = 0;
const CATID CATID_SafeForScripting = {0x7dd95801,0x9882,0x11cf,{0x9f,0xa9,0x00,0xaa,0x00,0x6c,0x42,0xc4}};
const CATID CATID_SafeForInitializing = {0x7dd95802,0x9882,0x11cf,{0x9f,0xa9,0x00,0xaa,0x00,0x6c,0x42,0xc4}};
const GUID CDECL BASED_CODE _clsid =
{ 0x6d3f3525, 0xe4e0, 0x11d3, { 0xa0, 0x5e, 0, 0xa0, 0xc9, 0xaf, 0xee, 0x48 } };
////////////////////////////////////////////////////////////////////////////
// CMvrCtrlApp::InitInstance - DLL の初期化
CMvrCtrlApp::CMvrCtrlApp()
{
m_pControlWnd = NULL;
m_DecID = 0;
}
BOOL CMvrCtrlApp::InitInstance()
{
BOOL bInit = COleControlModule::InitInstance();
if (bInit)
{
// TODO: この位置にモジュールの初期化処理コードを追加してください。
}
return bInit;
}
////////////////////////////////////////////////////////////////////////////
// CMvrCtrlApp::ExitInstance - DLL の終了
int CMvrCtrlApp::ExitInstance()
{
// TODO: この位置にモジュールの終了処理を追加してください。
return COleControlModule::ExitInstance();
}
/////////////////////////////////////////////////////////////////////////////
// DllRegisterServer - システム レジストリのエントリを追加
STDAPI DllRegisterServer(void)
{
AFX_MANAGE_STATE(_afxModuleAddrThis);
if (!AfxOleRegisterTypeLib(AfxGetInstanceHandle(), _tlid))
return ResultFromScode(SELFREG_E_TYPELIB);
if (!COleObjectFactoryEx::UpdateRegistryAll(TRUE))
return ResultFromScode(SELFREG_E_CLASS);
// スクリプトを実行しても安全であるマークをつける
CreateComponentCategory(CATID_SafeForScripting, L"Controls that are safely scriptable");
RegisterCLSIDInCategory(_clsid, CATID_SafeForScripting);
CreateComponentCategory(CATID_SafeForInitializing, L"Controls safely initializable from persistent data");
RegisterCLSIDInCategory(_clsid, CATID_SafeForInitializing);
//
return NOERROR;
}
/////////////////////////////////////////////////////////////////////////////
// DllUnregisterServer - システム レジストリからのエントリを削除
STDAPI DllUnregisterServer(void)
{
AFX_MANAGE_STATE(_afxModuleAddrThis);
// スクリプトを実行しても安全であるマークをのける
UnRegisterCLSIDInCategory(_clsid, CATID_SafeForScripting);
UnRegisterCLSIDInCategory(_clsid, CATID_SafeForInitializing);
//
if (!AfxOleUnregisterTypeLib(_tlid, _wVerMajor, _wVerMinor))
return ResultFromScode(SELFREG_E_TYPELIB);
if (!COleObjectFactoryEx::UpdateRegistryAll(FALSE))
return ResultFromScode(SELFREG_E_CLASS);
return NOERROR;
}