zar
zar

Reputation: 12227

'Guideline must specify type' error while opening rc file in VS2010

I have an MFC project where everything was working perfectly fine and I checked in my code in source control (perforce). All of a sudden the .rc file wouldn't open. When I try to open, it gives an error Guideline must specify type @ line# 410 which is this:

#ifdef APSTUDIO_INVOKED
GUIDELINES DESIGNINFO
BEGIN
    IDD_ABOUTBOX, DIALOG
    BEGIN
        , 50
    END

Now granted, it does seem to be missing an entry when I compare it to other projects but I didn't manually change anything in the rc file and VS2010 has been handling it exclusively. I don't know when these entries got changed. I got everything from perforce to a new folder and rc file would still not open! Is there any better solution or do I have to just change the entries manually in hope that it will fix it?

Upvotes: 2

Views: 5697

Answers (4)

bramoin
bramoin

Reputation: 11

I found out that if there is a dialog that was created before but the ID of the dialog was changed manually in the .rc file, then the dialog definition in the .rc file causes the corruption. So, I looked through the previous working version of the .rc file and found the dialog ID which is no longer defined in the resource.h file and removed it from the .rc file. I also found that the GUIDELINES DESIGNINFO section for a dialog can be empty i.e. it is ok to have a dialog definition without any Margin information at all. The unknown dialog definition in this GUIDELINES DESIGNINFO block will cause VS2010 to produce the entry ",50" which will make other dialogs to come up with an additional dotted box or with a purple background.

Upvotes: 1

zar
zar

Reputation: 12227

It turned out the rc file was somehow corrupted by VS2010 at some point. I had the original version in source control and re-merged them manually to fix it. The corrected code looks like this:

GUIDELINES DESIGNINFO
BEGIN
    IDD_ABOUTBOX, DIALOG
    BEGIN
        LEFTMARGIN, 7
        RIGHTMARGIN, 163
        TOPMARGIN, 7
        BOTTOMMARGIN, 55
    END
END

The VS2010 seems to corrupt the rc file randomly when you copy/paste a dialog to create a new one.

Upvotes: 3

Matthew
Matthew

Reputation: 1612

The "type" of the Guidline must be specified before the value. It should be one of:

LEFTMARGIN, RIGHTMARGIN, TOPMARGIN, BOTTOMMARGIN, VERTGUIDE, HORZGUIDE

Your code would be something like this:

IDD_INSTRUMENT_DIALOG, DIALOG
BEGIN
    BOTTOMMARGIN, 50
END

Upvotes: 1

Udo
Udo

Reputation: 11

After being bugged by this frequently, I've found a reason why VS2010 sometimes blows up the designinfo of the resource file: In my case there was a leftover designinfo entry for a dialog box that didn't exist any more, and even the IDD_ constant was already gone. VS2010 doesn't throw an error on that, and instead loads garbage.

And just for the google index: The german error message is "Führungslinie muss Typangabe enthalten".

Upvotes: 0

Related Questions