[Connect C++] Icon commands and CmdItemListRsc's

One of our applications includes a lot of icon commands and associated CmdItemListRsc's. According to the documentation the CmdItemListRsc's should be added like this:

CmdItemListRsc CMD_PLACE_SOMETHING =
{
{
{{2 * XC, GENY(1), 0, 0}, ToggleButton, TOGGLEID_LockGrid, ON, 0, "", ""},
{{2 * XC, GENY(2), 0, 0}, ToggleButton, TOGGLEID_LockGraphicGroup, ON, 0, "", ""},
}
};
This works fine in V8i, but in MS Connect the first line gives me a compiler error saying: "error: not an integer constant".
The dlogdemo example uses an enum value instead of the command number. When i try this the application can be compiled but the items doesn't appear as tool settings.
What can I do to go on?
TIA, Evan
Parents
  • Disconnect between DItem_IconCmdRsc IDs and Command Table

    Unknown said:
    the first line gives me a compiler error saying: "error: not an integer constant"

    I notice that theDialogBoxDemo example does not #include "command.h" generated from the command table, which would explain that message.  The DialogBoxDemo example DItem_IconCmdRsc IDs are just a list of values, unconnected with the command table.

    Does it work if you include the command header and use the command macro (CMD_XXX)?

    Unecessary Legacy Code

    I notice that the example includes tests like this:

    #if defined (MSVERSION) && (MSVERSION >= 0x550)
    

    MicroStation SE passed by many years ago.  That test will always succeed for CONNECT and should be removed.  An example that contains pointless code is not a good example.

    enum is fine in Resource file

    Unknown said:
    The dlogdemo example uses an enum value instead of the command number

    You can use an enum to define resource IDs such as dialog item numbers.  That's long been possible and became available in V8.  It saves a lot of typing (all those #defines) and helps to ensure that modifications to an enum list don't result in duplicate IDs.

     
    Regards, Jon Summers
    LA Solutions

  • Is there a help document to reference for the cmditemlistrsc element?  I do not understand the parts of it and would like to use the help docs as much as possible 

Reply Children