VST 3.6.11 IDropTarget compile errors on Windows

So, I tried updating to the new VSTGUI version.

IDropTarget has name collision with Win32 OLE struct.
OLE spams its name into global namespace with no sensible restraints (#if block etc)

Normally, one just defines WIN32_MEAN_AND_LEAN to be rid of lots of crud,
but D2D drawing headers include oleidl.h etc, so this doesn’t work.

How do you get it to compile on your machines?
To me the simplest is just to rename VSTGUI IDropTarget, it’s going to cause grief to more people.

Any advise appreciated.


This can only happen if you have somewhere “using namespace VSTGUI” in your header.
So remove it.


Ah. Thanks for that. I had it in one place, removing that cleared up my code.


Now these lines would never work in /vstgui/vstgui.h : 68

using namespace VSTGUI;

So that macro needs to be defined always?

When I define it in my project it seems we need a couple of fixes in aeffguieditor.h/cpp

aeffguieditor.h : 21
class AEffGUIEditor : public AEffEditor, public **VSTGUI::**VSTGUIEditorInterface

aeffguieditor.h : 59
virtual bool beforeSizeChange (const **VSTGUI::**CRect& newSize, const **VSTGUI::**CRect& oldSize);

and the same in aeffguieditor.cpp : 113
int32_t AEffGUIEditor::knobMode = **VSTGUI::**kCircularMode;

and aeffguieditor.cpp : 204
bool AEffGUIEditor::beforeSizeChange (const **VSTGUI::**CRect& newSize, const **VSTGUI::**CRect& oldSize)

Am I missing something else?

EDIT next day:

I managed to compile without the VSTGUI_DISABLE_GLOBAL_NAMESPACE_POLLUTION macro,
while also getting away from the IDropTarget redefinition errors.

This is done by moving
#include <windows.h>

so that it precedes any vstgui header inclusion.
At least in aeffguieditor.cpp as well as any of your own files (your AudioEffectX implementation file for instance)

And you need to
#undef max
#undef min

EDIT next day
(and define UNICODE in preprocessor flags, else aeffguieditor.cpp fails. I probably lost that while fiddling the other flags)
Was in this edit, but it’s irrelevant to thread topic, so removed now.


Hi rasmus,
please checkout the master branch from GitHub (https://github.com/steinbergmedia/vstgui).
It should contain the necessary fixes to get you going and let me know if it works for you.


Ah, I got it working in the end, but much better to have the official.

Thanks for quick fix!