# Issues updating to vstgui 4.7 (IDropTarget redefinition)

**URL:** <https://forums.steinberg.net/t/issues-updating-to-vstgui-4-7-idroptarget-redefinition/202086>\
**Category:** VSTGUI\
**Created:** [November 19, 2020, 9:50am UTC](https://forums.steinberg.net/t/issues-updating-to-vstgui-4-7-idroptarget-redefinition/202086 "2020-11-19T09:50:01Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![rjonkman](https://avatars.discourse-cdn.com/v4/letter/r/b5e925/32.png) [@rjonkman](https://forums.steinberg.net/u/rjonkman)\
**Post date:** [November 19, 2020, 9:50am UTC](https://forums.steinberg.net/t/issues-updating-to-vstgui-4-7-idroptarget-redefinition/202086/1 "2020-11-19T09:50:01Z")

</div>

I’m trying to update from vstgui 4.6 to 4.7, and I’ve run into an issue. Looks like there’s a conflict with IDropTarget and Windows Kits SDK.  
 ![Screenshot 2020-11-19 174545.png](https://europe1.discourse-cdn.com/steinberg/original/3X/d/8/d8eb67f0fff43ad922716f26e7ad97bf7d7b5d05.png)

 ![Screenshot 2020-11-19 174622.png](https://europe1.discourse-cdn.com/steinberg/original/3X/0/9/0945d5c57bbe059a4f521d6ca52e15d572b692ce.png)

---

<div class="post-metadata">

**Author:** ![Arne\_Scheffler](https://dub1.discourse-cdn.com/steinberg/user_avatar/forums.steinberg.net/arne_scheffler/32/92023_2.png) [@Arne\_Scheffler](https://forums.steinberg.net/u/Arne_Scheffler)\
**Post date:** [November 19, 2020, 9:57am UTC](https://forums.steinberg.net/t/issues-updating-to-vstgui-4-7-idroptarget-redefinition/202086/2 "2020-11-19T09:57:07Z")

</div>

This happens because you have somewhere:

```nohighlight
using namespace VSTGUI;

```

in some of your headers. This is not supported anymore.  
You have to get rid of it.

---

<div class="post-metadata">

**Author:** ![rjonkman](https://avatars.discourse-cdn.com/v4/letter/r/b5e925/32.png) [@rjonkman](https://forums.steinberg.net/u/rjonkman)\
**Post date:** [November 19, 2020, 12:34pm UTC](https://forums.steinberg.net/t/issues-updating-to-vstgui-4-7-idroptarget-redefinition/202086/3 "2020-11-19T12:34:55Z")

</div>

If I don’t use the VSTGUI namespace, then all my custom classes won’t compile unless I add the namespace everywhere. Is there not a better solution? I have probably a hundred custom classes. I use CRect probably about 1000 times. Do I really need to say VSTGUI::CRect every time I want to work with a rectangle?

---

<div class="post-metadata">

**Author:** ![rjonkman](https://avatars.discourse-cdn.com/v4/letter/r/b5e925/32.png) [@rjonkman](https://forums.steinberg.net/u/rjonkman)\
**Post date:** [November 19, 2020, 12:51pm UTC](https://forums.steinberg.net/t/issues-updating-to-vstgui-4-7-idroptarget-redefinition/202086/4 "2020-11-19T12:51:24Z")

</div>

Looks like I might be able to use a typedef for all the primitives I use. For example…

```nohighlight
typedef VSTGUI::CDrawContext CDrawContext;

```

---

<div class="post-metadata">

**Author:** ![rjonkman](https://avatars.discourse-cdn.com/v4/letter/r/b5e925/32.png) [@rjonkman](https://forums.steinberg.net/u/rjonkman)\
**Post date:** [November 19, 2020, 11:29pm UTC](https://forums.steinberg.net/t/issues-updating-to-vstgui-4-7-idroptarget-redefinition/202086/5 "2020-11-19T23:29:28Z")

</div>

Seems to be more trouble than it’s worth. I was hoping to get up to version 4.9, but I guess 4.6 is as far as I go.

---

<div class="post-metadata">

**Author:** ![rjonkman](https://avatars.discourse-cdn.com/v4/letter/r/b5e925/32.png) [@rjonkman](https://forums.steinberg.net/u/rjonkman)\
**Post date:** [November 20, 2020, 12:44am UTC](https://forums.steinberg.net/t/issues-updating-to-vstgui-4-7-idroptarget-redefinition/202086/6 "2020-11-20T00:44:59Z")

</div>

…I don’t like giving up…I’m now compiling with vstgui 4.9 and I’m down to just one error:

 ![Screenshot 2020-11-20 083946.png](https://europe1.discourse-cdn.com/steinberg/original/3X/1/d/1de0abc80eef24e91b8ef4f077913856f00ae59e.png)  
Also, can I recommend a couple changes to prevent over people from having issues…

In csegmentbutton.h, change…

```nohighlight
static constexpr uint32_t kPushBack = std::numeric_limits<uint32_t>::max ();

```

to…

```nohighlight
static constexpr uint32_t kPushBack = (std::numeric_limits<uint32_t>::max) ();

```

…and also, in vstguifwd.h change …

```nohighlight
static constexpr uint32_t kStreamIOError = std::numeric_limits<uint32_t>::max ();

```

to…

```nohighlight
static constexpr uint32_t kStreamIOError = (std::numeric_limits<uint32_t>::max) ();

```

---

<div class="post-metadata">

**Author:** ![rjonkman](https://avatars.discourse-cdn.com/v4/letter/r/b5e925/32.png) [@rjonkman](https://forums.steinberg.net/u/rjonkman)\
**Post date:** [November 20, 2020, 1:03am UTC](https://forums.steinberg.net/t/issues-updating-to-vstgui-4-7-idroptarget-redefinition/202086/7 "2020-11-20T01:03:30Z")

</div>

After doing some additional hacking in malloc.h, I’ve managed to compile and run my application in VSTGUI 4.9 on Windows. Let’s see how things fair on macOS…

As a note, to get my custom classes to compile, I had to create a header file full of typedefs and macros for all the classes and enums I use from the VSTGUI namespace.

```nohighlight
#ifndef __AF_VSTGUI_DEFS__
#define __AF_VSTGUI_DEFS__

#ifndef __APPLE__
#include "lib\platform\win32\win32support.h" // for UTF8StringHelper
#endif

typedef VSTGUI::CView CView;
typedef VSTGUI::CDrawContext CDrawContext;
typedef VSTGUI::CRect CRect;
typedef VSTGUI::CPoint CPoint;
typedef VSTGUI::CBitmap CBitmap;
typedef VSTGUI::CVSTGUITimer CVSTGUITimer;
typedef VSTGUI::CColor CColor;
typedef VSTGUI::CMouseEventResult CMouseEventResult;
typedef VSTGUI::CMessageResult CMessageResult;
typedef VSTGUI::CButtonState CButtonState;
typedef VSTGUI::CBaseObject CBaseObject;
typedef VSTGUI::IControlListener IControlListener;
typedef VSTGUI::CGraphicsPath CGraphicsPath;
typedef VSTGUI::CCoord CCoord;
typedef VSTGUI::CFrame CFrame;
typedef VSTGUI::CFontRef CFontRef;
typedef VSTGUI::CFontDesc CFontDesc;
typedef VSTGUI::CGraphicsTransform CGraphicsTransform;
typedef VSTGUI::CLineStyle CLineStyle;
typedef VSTGUI::UTF8String UTF8String;
typedef VSTGUI::UTF8StringPtr UTF8StringPtr;
typedef VSTGUI::UTF8StringHelper UTF8StringHelper;
typedef VSTGUI::COpenGLView COpenGLView;
typedef VSTGUI::COffscreenContext COffscreenContext;
typedef VSTGUI::CTextLabel CTextLabel;
typedef VSTGUI::CGradient CGradient;
typedef VSTGUI::CControl CControl;
typedef VSTGUI::CViewContainer CViewContainer;
typedef VSTGUI::CTextEdit CTextEdit;
typedef VSTGUI::COnOffButton COnOffButton;
typedef VSTGUI::COptionMenu COptionMenu;
typedef VSTGUI::CScrollView CScrollView;
typedef VSTGUI::CMouseWheelAxis CMouseWheelAxis;
typedef VSTGUI::CMenuItem CMenuItem;
typedef VSTGUI::CLayeredViewContainer CLayeredViewContainer;
typedef VSTGUI::CScrollContainer CScrollContainer;
typedef VSTGUI::PixelFormat PixelFormat;

constexpr const CColor kTransparentCColor = CColor(255, 255, 255, 0);
constexpr const CColor kBlackCColor = CColor(0, 0, 0, 255);
constexpr const CColor kWhiteCColor = CColor(255, 255, 255, 255);
constexpr const CColor kGreyCColor = CColor(127, 127, 127, 255);
constexpr const CColor kRedCColor = CColor(255, 0, 0, 255);
constexpr const CColor kGreenCColor = CColor(0, 255, 0, 255);
constexpr const CColor kBlueCColor = CColor(0, 0, 255, 255);
constexpr const CColor kYellowCColor = CColor(255, 255, 0, 255);
constexpr const CColor kMagentaCColor = CColor(255, 0, 255, 255);
constexpr const CColor kCyanCColor = CColor(0, 255, 255, 255);

#define kAntiAliasing VSTGUI::kAntiAliasing
#define kNonIntegralMode VSTGUI::kNonIntegralMode
#define kMessageNotified VSTGUI::kMessageNotified

#define kDrawStroked VSTGUI::kDrawStroked
#define kDrawFilled VSTGUI::kDrawFilled
#define kDrawFilledAndStroked VSTGUI::kDrawFilledAndStroked

#define kLeftText VSTGUI::kLeftText
#define kCenterText VSTGUI::kCenterText
#define kRightText VSTGUI::kRightText

#define kNormalFont VSTGUI::kNormalFont
#define kNormalFontBig VSTGUI::kNormalFontBig
#define kNormalFontVeryBig VSTGUI::kNormalFontVeryBig
#define kNormalFontSmall VSTGUI::kNormalFontSmall
#define kNormalFontSmaller VSTGUI::kNormalFontSmaller
#define kNormalFontVerySmall VSTGUI::kNormalFontVerySmall

#define kMouseEventNotImplemented VSTGUI::kMouseEventNotImplemented
#define kMouseEventHandled VSTGUI::kMouseEventHandled
#define kMouseEventNotHandled VSTGUI::kMouseEventNotHandled
#define kMouseDownEventHandledButDontNeedMovedOrUpEvents VSTGUI::kMouseDownEventHandledButDontNeedMovedOrUpEvents
#define kMouseMoveEventHandledButDontNeedMoreEvents VSTGUI::kMouseMoveEventHandledButDontNeedMoreEvents

#define kCursorDefault VSTGUI::kCursorDefault
#define kCursorWait VSTGUI::kCursorWait
#define kCursorHSize VSTGUI::kCursorHSize
#define kCursorVSize VSTGUI::kCursorVSize
#define kCursorSizeAll VSTGUI::kCursorSizeAll
#define kCursorNESWSize VSTGUI::kCursorNESWSize
#define kCursorNWSESize VSTGUI::kCursorNWSESize
#define kCursorCopy VSTGUI::kCursorCopy
#define kCursorNotAllowed VSTGUI::kCursorNotAllowed
#define kCursorHand VSTGUI::kCursorHand
#define kCursorIBeam VSTGUI::kCursorIBeam

#define kNormalFace VSTGUI::kNormalFace
#define kBoldFace VSTGUI::kBoldFace
#define kItalicFace VSTGUI::kItalicFace
#define kUnderlineFace VSTGUI::kUnderlineFace
#define kStrikethroughFace VSTGUI::kStrikethroughFace

#define kLButton VSTGUI::kLButton
#define kMButton VSTGUI::kMButton
#define kRButton VSTGUI::kRButton
#define kShift VSTGUI::kShift
#define kControl VSTGUI::kControl
#define kAlt VSTGUI::kAlt
#define kApple VSTGUI::kApple
#define kButton4 VSTGUI::kButton4
#define kButton5 VSTGUI::kButton5
#define kDoubleClick VSTGUI::kDoubleClick
#define kMouseWheelInverted VSTGUI::kMouseWheelInverted

#endif

```
