Click here to Skip to main content
12,697,783 members (26,353 online)
Click here to Skip to main content

Stats

181.6K views
3.4K downloads
82 bookmarked
Posted

A Cleanup API for Windows

, 24 Aug 2006 CPOL
Provides a general cleanup API for Windows, ported into Win32 and COM dynamic-link libraries.
Cleanup_DLL_Win32
Release
Cleanup.dll
Cleanup_Win32.lib
Cleanup_Client_COM
Cleanup_COM.tlb
Release
Cleanup_Client_COM.exe
res
Cleanup_Client.ico
Cleanup_Client.manifest
Cleanup_Client_CS
App.ico
bin
Release
Cleanup_Client_CS.exe
Interop.Cleanup_COMLib.dll
Cleanup_Client_C3.csproj.user
Cleanup_Client_CS.csproj.user
Cleanup_Client_MFC
Cleanup_Win32.lib
Release
Cleanup.dll
Cleanup_Client_MFC.exe
res
Cleanup_Client.ico
Cleanup_Client.manifest
Cleanup_DLL_COM
Cleanup_COM.def
Cleanup_COM.rgs
Cleanup_COMps.def
CleanupAPI.rgs
Release
Cleanup.dll
Cleanup_COM.tlb
// Cleanup_COM.cpp : Implementation of DLL Exports.

#include "stdafx.h"
#include "resource.h"
#include "Cleanup_COM.h"

class CCleanup_COMModule : public CAtlDllModuleT< CCleanup_COMModule >
{
public :
	DECLARE_LIBID(LIBID_Cleanup_COMLib)
	DECLARE_REGISTRY_APPID_RESOURCEID(IDR_CLEANUP_COM, "{EEE2BC6F-047C-491C-95BD-9463A0D7ABB0}")
};

CCleanup_COMModule _AtlModule;


// 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;
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Marcel Lambert
United States United States
No Biography provided

You may also be interested in...

| Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.170118.1 | Last Updated 24 Aug 2006
Article Copyright 2006 by Marcel Lambert
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid