Click here to Skip to main content
13,293,173 members (36,535 online)
Click here to Skip to main content


81 bookmarked
Posted 18 Sep 2002

Shell Extensions for .NET Assemblies

, 17 Nov 2005
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 :

CAsmShellModule _AtlModule;

// DLL Entry Point
extern "C" BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
    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.


This article, along with any associated source code and files, is licensed under The Microsoft Public License (Ms-PL)


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...

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