VDJPedia



 Plugins_Wrapper

If you plan to create a wrapper or an external tool to read the dll, here is an example with a plugin created with IID_IVdjPluginBasic8

HRESULT LoadDLL(TCHAR *strFileName)
{
HRESULT hr;
HMODULE hDLL;
typedef HRESULT (VDJ_API *dllGetClassObjectType)(IN REFCLSID rclsid, IN REFIID riid, OUT LPVOID FAR* ppv);
IVdjPlugin8 *pClf;
TVdjPluginInfo8 info8;

hDLL = LoadLibrary(strFileName);
if( hDLL == NULL ) return S_FALSE;

dllGetClassObjectType dllGetClassObject1 = (dllGetClassObjectType) GetProcAddress(hDLL,"_DllGetClassObject@12");
if( dllGetClassObject1 == NULL )
{
FreeLibrary(hDLL);
return S_FALSE;
}

hr = dllGetClassObject1(CLSID_VdjPlugin8, IID_IVdjPluginBasic8, (void**) &pClf); // find, create and get the class defned in the VirtualDJ plugin
if(hr==CLASS_E_CLASSNOTAVAILABLE)
{
FreeLibrary(hDLL);
return S_FALSE;
}

if(hr==NO_ERROR)
{
pClf->hInstance = ....; // give a HINSTANCE to the VirtualDJ plugin

hr = pClf->OnGetPluginInfo(&info8); // get the info from the VirtualDJ plugin

pClf->Release();

FreeLibrary(hDLL);
return S_OK;
}
}