What does the acronym IDC mean?

yussuf picture yussuf · Jan 11, 2012 · Viewed 9.7k times · Source

Does anybody know the meaning of the acronym IDC as it is used when programming windows?

e.g. in the context of a CDialog application:

void CMyDialog::DoDataExchange(CDataExchange* pDX)
{
    CDialog::DoDataExchange(pDX);
    DDX_Control(pDX, IDC_STATIC_FRAME, m_StaticFrame);
}

Is it generally the ID of a not further specified Control (ID Control), as a Dialog would have the prefix IDD (ID Dialog)?

Answer

Cody Gray picture Cody Gray · Jan 11, 2012

Is it generally the ID of a not further specified Control (ID Control), as a Dialog would have the prefix IDD (ID Dialog)?

Yes, that's precisely correct.

By convention, Win32 resource scripts use special prefixes to identify the type of an identifier.
A partial list looks something like this:

  • IDA = An accelerator table resource
  • IDB = A bitmap resource
  • IDC = A command identifier
  • IDD = A dialog box resource
  • IDI = An icon resource
  • IDM = A menu command identifier
  • IDR = Multiple resource types, perhaps those common to an entire application or window
  • IDS = A string resource
  • ID = An unknown or custom resource

Sometimes, you'll see IDC used for cursors, rather than command identifiers. It's hard to say without looking at the usage whether that's the case.

But note that using these is completely optional. It doesn't mean anything to the compiler or the computer, it's only designed to remind the programmer of what the identifier refers to.