git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@57557 
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
 #endif
 
 #include "wx/private/socket.h"
+#include "wx/msw/private.h"     // for wxGetInstance()
 #include "wx/apptrait.h"
 #include "wx/thread.h"
 #include "wx/dynlib.h"
 
-extern "C" WXDLLIMPEXP_BASE HINSTANCE wxGetInstance();
-#define INSTANCE wxGetInstance()
-
 #ifdef __WXWINCE__
 /*
  * As WSAAsyncSelect is not present on WinCE, it now uses WSACreateEvent,
 #endif
   /* Destroy internal window */
   DestroyWindow(hWin);
-  UnregisterClass(CLASSNAME, INSTANCE);
+  UnregisterClass(CLASSNAME, wxGetInstance());
 
   WSACleanup();