0

I have a resource script (*.rc) that needs to use WIZ_CXDLG from commctrl.h/CommCtrl.pas. The original version does this via #include:

#include <windows.h>
#include <commctrl.h>

1 DIALOGEX 0, 0, WIZ_CXDLG, WIZ_CYDLG
//...

However this doesn't compile in a Delphi XE6 project, neither with the Borland nor the MS resource compiler because commctrl.h isn't found.

What's the correct way to resolve this? I could probably download the Windows SDK but that seems like overkill.

Edit: FWIW - #include-ing CommCtrl.pas doesn't work. In XE6 brcc32 apparently chokes on the WinApi. prefix. In D2007 brcc32 stops at the interface uses clause. However we already successfully used simpler Pascal files like

unit MyProject_rc;

interface

/////////////////////////////////////////////////////////////////////////////
//
// Cursor
//

const
  IDC_CURSOR_FOO = 1;
//[SNIP]

implementation

end.
Uli Gerhardt
  • 13,748
  • 1
  • 45
  • 83

1 Answers1

1

I would compile this the Microsoft resource compiler, against the Windows SDK. That will mean installing the Windows SDK. You think that's overkill, but I personally feel it's a very important and useful resource for Windows developers.

If you really don't want to install the SDK, modify the resource file to include the necessary definitions.

#define WIZ_CXDLG   276
#define WIZ_CYDLG   140
// etc.
David Heffernan
  • 601,492
  • 42
  • 1,072
  • 1,490