Windows ICO Files in MDL

Bruce,

Thanks for your reply.  I assume I'm close to having this work.  As I mentioned I have the compiled RSC file in a folder in the MS_ICONPATH but the icon graphics is not showing up.  Here is some of my code.

I declare the following icon:
DItem_IconCmdRsc ICONID_Find =
{
   NOHELP, MHELP, 0, CMD_FIND_COMPONENT, OTASKID, "", "",
   { }
};

IconRsc ICONID_Find =
{
   32, 32, ICONFORMAT_WINDOWSICO, BLACK_INDEX, "Search", "Search"
};

The example shows the 5th property as blank and the 6th property of the IconRsc structure to be a name.  Looking at the definition in dlogbox.h the 5th should be the name.  So I set both properties to the name of the icon.

For the tool box I have the following:

DItem_ToolBoxRsc ICONCMDFRAMEID_Components =
{
  NOHELP, MHELP, NOHOOK, NOARG, 0, "Components",
  {
    {{0, 0, 0, 0}, IconCmd, ICONCMDID_Cell_BUILD_COMPONENT,    ON, 0, "", ""},
    {{0, 0, 0, 0}, IconCmd, ICONID_Find,    ON, 0, "", ""},
  }
};

The other icon was built by the old method of building the icon in iconedit and extracting the definition and putting it into the .R file.

Do you see anything above that is incorrect?

Thanks,  Jim

  • I too kept the 5th property blank (""), and the 6th  property as the quoted icon name. I was creating a DialogBox with ButtonGroupRsc instead of a ToolBox. I inserted the actual icon graphics in a .dll file using Visual Studio, and renamed them to match the text strings in the IconRsc. I tried (briefly, without success) to put the icons into a RSC file, but I never got it to "work" - I did using the .dll approach, so that's what I went with.

    Bruce

  • I too kept the 5th property blank (""), and the 6th  property as the quoted icon name. I was creating a DialogBox with ButtonGroupRsc instead of a ToolBox. I inserted the actual icon graphics in a .dll file using Visual Studio, and renamed them to match the text strings in the IconRsc. I tried (briefly, without success) to put the icons into a RSC file, but I never got it to "work" - I did using the .dll approach, so that's what I went with.

     

    Bruce