I have a dialog window with a Tree-View control where the user can drag the items to rearrange the tree.
It looks and behaves differently when it is used in an executable and in an MS Excel add-in XLL.
It looks like this during a drag operation when used in an executable(this is the desired look):
But when I use the same dialog in an MS Excel add-in XLL(where it is displayed when user selects a command) it looks like this(notice the missing tooltip, and icons for expanded items):
What could be causing this? Is there a way I can make the dialog look like the way it does when used in an executable?
I suspect it has to do with the ComCtl32.dll version, as the following returns version 6.16 when called from the executable, but 5.82 when called from XLL:
HINSTANCE hinstDll = LoadLibrary(lpszDllName);
DLLGETVERSIONPROC pDllGetVersion =
(DLLGETVERSIONPROC)GetProcAddress(hinstDll, "DllGetVersion");
I have the following manifest in the .cpp file.
#include <commctrl.h>
#pragma comment(lib, "comctl32.lib")
// Enable Visual Style
#if defined _M_IX86
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='x86' publicKeyToken='6595b64144ccf1df' language='*'\"")
#elif defined _M_IA64
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='ia64' publicKeyToken='6595b64144ccf1df' language='*'\"")
#elif defined _M_X64
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='amd64' publicKeyToken='6595b64144ccf1df' language='*'\"")
#else
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"")
#endif