【VC开源代码栏目提醒】:以下是网学会员为您推荐的VC开源代码-CDInfo.cpp,希望本篇文章对您学习有所帮助。
// CDInfo.cpp : Implementation of DLL Exports.
//
// This is a part of the Active Template Library.
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// This source code is only intended as a supplement to the
// Active Template Library Reference and related
// electronic documentation provided with the library.
// See these sources for detailed information regarding the
// Active Template Library product.
#include "stdafx.h"
#include "resource.h"
#include <initguid.h>
#include "CDInfo_h.h"
#define IID_DEFINED
#include "CDInfo_i.c"
#include "CDInfo1.h"
class CCDInfoModule : public CAtlDllModuleT< CCDInfoModule >
{
public :
DECLARE_LIBID(LIBID_CDInfoLib)
DECLARE_REGISTRY_APPID_RESOURCEID(IDR_CDInfo, "{A393BE4E-2FBD-11D0-B939-000000000000}")
};
CCDInfoModule _AtlModule;
OBJECT_ENTRY_AUTO(CLSID_CCDInfo, CCDInfo)
/////////////////////////////////////////////////////////////////////////////
// DLL Entry Point
extern "C" BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
{
hInstance;
return _AtlModule.DllMain(dwReason, lpReserved);
}
// Used to determine whether the DLL can be unloaded by OLE
STDAPI DllCanUnloadNow(void)
{
return _AtlModule.DllCanUnloadNow();
}
// Returns a class factory to create an object of the requested type
STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
{
return _AtlModule.DllGetClassObject(rclsid, riid, ppv);
}
// DllRegisterServer - Adds entries to the system registry
STDAPI DllRegisterServer(void)
{
// registers object, typelib and all interfaces in typelib
HRESULT hr = _AtlModule.DllRegisterServer();
return hr;
}
// DllUnregisterServer - Removes entries from the system registry
STDAPI DllUnregisterServer(void)
{
HRESULT hr = _AtlModule.DllUnregisterServer();
return hr;
}
上一篇:
CDIB.CPP
下一篇:
让我掉下眼泪的