The format that you have there from FreeBasic isn't a standard resource file (.rc) format, which is generally oriented towards C/C++. Here's what a resource file looks like that's generated by Visual C++, which is the de facto standard:
[code=c]
// Microsoft Visual C++ generated resource script.
//
#include "resource.h"
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "afxres.h"
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
// English (U.S.) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252)
#endif //_WIN32
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//
1 TEXTINCLUDE
BEGIN
"resource.h\0"
END
2 TEXTINCLUDE
BEGIN
"#include ""afxres.h""\r\n"
"\0"
END
3 TEXTINCLUDE
BEGIN
"#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r\n"
"#ifdef _WIN32\r\n"
"LANGUAGE 9, 1\r\n"
"#pragma code_page(1252)\r\n"
"#endif //_WIN32\r\n"
"#include ""afxres.rc"" // Standard components\r\n"
"#endif\r\n"
"\0"
END
#endif // APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Version
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,0,0,0
PRODUCTVERSION 1,0,0,0
FILEFLAGSMASK 0x0L
#ifdef _DEBUG
FILEFLAGS 0x1L
#else
FILEFLAGS 0x0L
#endif
FILEOS 0x4L
FILETYPE 0x1L
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904e4"
BEGIN
VALUE "Comments", "This is a comment"
VALUE "CompanyName", "Company Name"
VALUE "FileDescription", "File Description"
VALUE "FileVersion", "1.0.0.0"
VALUE "InternalName", "FILENAME"
VALUE "LegalCopyright", "Copyright 2008 Some Company. All rights reserved."
VALUE "OriginalFilename", "FILENAME.EXE"
VALUE "ProductName", "Product Name"
VALUE "ProductVersion", "1.0.0.0"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1252
END
END
/////////////////////////////////////////////////////////////////////////////
//
// Dialog
//
IDD_MAINDIALOG DIALOGEX 0, 0, 295, 170
STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION
CAPTION "Main Dialog"
FONT 8, "Tahoma", 400, 0, 0x0
BEGIN
ICON 32516,IDC_STATIC,14,15,20,20
LTEXT "Text message",IDC_STATIC,41,15,239,18
LTEXT "Label1:",IDC_STATIC,100,61,164,10
EDITTEXT IDC_EDIT1,100,86,158,13,ES_AUTOHSCROLL
LTEXT "Label2:",IDC_STATIC,41,104,53,10
EDITTEXT IDC_EDIT2,100,102,158,13,ES_AUTOHSCROLL
LTEXT "Label3:",IDC_STATIC,41,120,47,10
EDITTEXT IDC_EDIT3,100,119,158,13,ES_AUTOHSCROLL
DEFPUSHBUTTON "OK",IDOK,94,149,48,14
PUSHBUTTON "Cancel",IDCANCEL,153,149,48,14
END
/////////////////////////////////////////////////////////////////////////////
//
// Menu
//
IDR_MENU1 MENU
BEGIN
POPUP "&File"
BEGIN
MENUITEM "E&xit\tAlt-F4", ID_FILE_EXIT
END
POPUP "&Help"
BEGIN
MENUITEM "&Contents\tF1", ID_HELP_CONTENTS
MENUITEM SEPARATOR
MENUITEM "&About", ID_HELP_ABOUT
END
END
/////////////////////////////////////////////////////////////////////////////
//
// Icon
//
// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
IDI_ICON1 ICON "res\\icon1.ico"
/////////////////////////////////////////////////////////////////////////////
//
// String Table
//
STRINGTABLE
BEGIN
IDS_VALUE1 "This is string value number one."
IDS_VALUE2 "This is string value number two."
IDS_VALUE3 "This is string value number three."
END
#endif // English (U.S.) resources
/////////////////////////////////////////////////////////////////////////////
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
LANGUAGE 9, 1
#pragma code_page(1252)
#endif //_WIN32
#include "afxres.rc" // Standard components
#endif
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED
[/code]
In short, your parser would need to understand C-style comments and macros. The definition of the constants (e.g.: IDD_MAINDIALOG) would be defined in a separate .h header file, not in the resource file itself, so you'd also need to be able to load and parse that as well.
Bookmarks