Click here to Skip to main content
12,622,252 members (36,796 online)
Click here to Skip to main content

Stats

144.5K views
2.4K downloads
81 bookmarked
Posted

Shell Extensions for .NET Assemblies

, 17 Nov 2005 Ms-PL
Shell extensions to distinguish between .NET assemblies and Win32 applications and libraries.
// AsmShell.cpp : Implementation of DLL Exports.

#include "stdafx.h"
#include "resource.h"
#include "AsmShell.h"

class CAsmShellModule : public CAtlDllModuleT< CAsmShellModule >
{
public :
	DECLARE_LIBID(LIBID_AsmShellLib)
	DECLARE_REGISTRY_APPID_RESOURCEID(IDR_ASMSHELL, "{6E9A0120-505E-43E1-A795-5DFD8EEF18FF}")
};

CAsmShellModule _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 Microsoft Public License (Ms-PL)

Share

About the Author

Heath Stewart
Software Developer Microsoft
United States United States
Heath Stewart is a happily married software engineer originally from the Midwest and a graduate of Iowa State University. Heath start programming early in life and enjoys continuous research and development in new languages, frameworks, and platforms. Fluent in many different programming languages, he has developed many large-scale software solutions for companies in different areas, such as Internet filtering, intrusion detection systems, production management systems, and web applications for various purposes. He also enjoys photography.

Currently, Heath is a Program Manager in the Visual Studio Professional Deployment Experience (VSPro DEX) team at Microsoft. Previous to his employment, he was a Microsoft MVP for Visual C#.

He is also a CodeProject protector and is happy to help the development community.

You may also be interested in...

| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.161128.1 | Last Updated 17 Nov 2005
Article Copyright 2002 by Heath Stewart
Everything else Copyright © CodeProject, 1999-2016
Layout: fixed | fluid