Hi, I have been trying to make a dialog, but I keep getting an error. I'm using Dev-C++ 4.9.9.2, and I get this error "[Resource error] syntax error". Here's my code for the dialog:

IDD_CONNECT DIALOG DISCARDABLE 0, 0, 300, 250
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Connect"
FONT 8, "MS Sans Serif"
BEGIN
    DEFPUSHBUTTON   "Connect",IDOK,174,18,50,14
    PUSHBUTTON      "Cancel",IDCANCEL,174,35,50,14
    GROUPBOX        "Connect Information...",IDC_STATIC,7,7,225,52
    CTEXT           "Enter the host/IP to connect to and click connect",
                    IDC_STATIC,16,18,144,33
END

You should be asking these people. I don't think Dev-C++ knows how to compile the resource files, but there are several free resource compilers available via google.

It can compile the input box dialog here: http://www.codeproject.com/KB/dialog/w32inputbox_1.aspx. That uses resources, so I don't think that's the problem. If you don't have a code project account, I have attached the files. The dev-c++ compiled file is program1.exe.

It's not program1.exe, I made a mistake. It's project1.exe.

#include <winresrc.h> in the .rc file, that way the definitions of e.g. DS_MODALFRAME and WS_POPUP will be known. In addition to that, add #define IDC_STATIC -1 in the resource.h file.

I got that *.zip file and tried to compile it, but Dev-C++ reports error that it cannot exec 'cc1'. It compiles the *.cpp files ok, but pukes at the resource file(s).

That's weird. It works for me. I'll try doing what you said.

Yes! It works! Thank you.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.