|
//------------------------------------------------------------------------------
#include "stdafx.h"
#include "resource.h"
#include <initguid.h>
#include "wmpplug.h"
#include "SheepWMP_h.h"
#include "SheepWMP_i.c"
#include "SheepWMP.h"
//------------------------------------------------------------------------------
CComModule _Module;
//------------------------------------------------------------------------------
BEGIN_OBJECT_MAP(ObjectMap)
OBJECT_ENTRY(CLSID_SheepWMP, CSheepWMP)
END_OBJECT_MAP()
//------------------------------------------------------------------------------
HINSTANCE gThisInstance = NULL ;
//------------------------------------------------------------------------------
extern "C"
BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID /*lpReserved*/)
{
if (dwReason == DLL_PROCESS_ATTACH)
{
gThisInstance = hInstance ;
_Module.Init(ObjectMap, hInstance, &LIBID_SHEEPWMPLib);
DisableThreadLibraryCalls(hInstance);
}
else if (dwReason == DLL_PROCESS_DETACH)
_Module.Term();
return TRUE; // ok
}
//------------------------------------------------------------------------------
STDAPI DllCanUnloadNow(void)
{
return (_Module.GetLockCount()==0) ? S_OK : S_FALSE;
}
//------------------------------------------------------------------------------
STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
{
return _Module.GetClassObject(rclsid, riid, ppv);
}
//------------------------------------------------------------------------------
STDAPI DllRegisterServer(void)
{
// registers object, typelib and all interfaces in typelib
HRESULT hr = _Module.RegisterServer();
// Notify WMP that plugin has been added
WMPNotifyPluginAddRemove();
return hr;
}
//------------------------------------------------------------------------------
STDAPI DllUnregisterServer(void)
{
HRESULT hr = _Module.UnregisterServer();
// Notify WMP that plugin has been removed
WMPNotifyPluginAddRemove();
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.
Developing windows applications for over 15 years now starting on Win 3.1 with Object Oriented Pascal, progressed to C++ and OWL, in 1996 switch to MFC and never looked back, now focusing on .NET/Mono.