Use Common Controls V6 in a .dll compiled using VC6

Pablo Glomby 181 Reputation points

I have a .dll compiled using VC6 (yes, I know it is a very old compiler but migrating is not a choice at this time).
I need to use the common dialogs 6, but it still loads the common dialogs 5.
I embedded a manifest using "2" as the ID but it still fails...

I coded (for testing) a very small VC6 Project and I used this code:

include <windows.h>

include <commctrl.h>

include <stdio.h>

include <stdlib.h>

include "resource.h"

HINSTANCE g_hInstance = NULL;

LONG PASCAL DlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);

extern "C" BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID /lpReserved/) {
if (dwReason == DLL_PROCESS_ATTACH) {
g_hInstance = hInstance;
return TRUE;

extern "C" __declspec(dllexport) void ShowDialog()

LONG PASCAL DlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
if (msg == WM_COMMAND && (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL)) {
EndDialog(hWnd, 1);
return FALSE;

Then I coded a little .exe that just calls ShowDialog...

If I use a .exe instead of a .dll it works fine (after embedding the manifest with ID 1).

this is the manifest:

<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity name="Test.Test.Test" processorArchitecture="x86" version="" type="win32"></assemblyIdentity>
<description>Windows Shell</description>
<assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="" processorArchitecture="x86" publicKeyToken="6595b64144ccf1df" language="*"></assemblyIdentity>

I embedded it using:
"C:......\Microsoft SDKs\Windows\v6.0\Bin\mt.exe" -manifest "zoptie.dll.Manifest.xml" -outputresource:"E:\temp\TestDll\Release\TestDll.dll";2

I can well see it is well embedded using PE Explorer:

But when I launch it, the look&feel is still the old one (the edit control should be flat):

What am I doing wrong?

Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
4,563 questions
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,513 questions
{count} votes

2 answers

Sort by: Most helpful
  1. RLWA32 39,906 Reputation points

    If I remember correctly in addition to embedding the manifest in the DLL with resource ID 2 you also need to build the DLL and #define ISOLATION_AWARE_ENABLED 1. But I don't know if this works with VC++ 6.

    See using-comctl32-version-6-in-an-application-that-uses-extensions-plug-ins-or-a-dll-that-is-brought-into-a-process

  2. RLWA32 39,906 Reputation points

    In order to accomplish what you want to do with ISOLATION_AWARE_ENABLED you need to install and build with a different Windows SDK than the one you are using.

    In a test, I installed the Microsoft Platform SDK February 2003 into VM containing VC++ 6 and used it to build a DLL that contained a dialog and was manifested to use the V6 Common Controls dll.

    When I copied that DLL to a Windows 8.1 system and used it to display the dialog it worked as anticipated as seen below (note main application has "old style" controls but the test dialog uses visual styles.


    0 comments No comments