Unidentified identifier on ConstructFromResourceL
Login to reply to this topic.
Sat, 2009-06-13 16:35
Joined: 2008-02-12
Forum posts: 77

I get "Unidentified identifier" when I try to load resources with ConstructFromResourceL. I have searched for the solution for this problem and the advice was to include the RSG file. I tried to do this, but then I get the error "can not open file". It seems like no RSG file is produced, I can't find it in the epoc32/include directory. What can I do to solve this problem? Here is the code from the cpp file:

iSettingItemList->ConstructFromResourceL(R_POLARLOTUSVISUAL_SETTING_ITEM_LIST);

and here is the rss file:

/*
============================================================================
Name : PolarLotusVisual.rss
Author : EA
Copyright : Mobile Visuals
Description : This file contains all the resources for the PolarLotusVisual.
============================================================================
*/
// RESOURCE IDENTIFIER
NAME POLA // 4 letter ID

// INCLUDES
#include
#include
#include
#include
#include "PolarLotusVisual.hrh"
#include "PolarLotusVisual.rls"

// RESOURCE DEFINITIONS
// -----------------------------------------------------------------------------
//
// Define the resource file signature
// This resource should be empty.
//
// -----------------------------------------------------------------------------
//
RESOURCE RSS_SIGNATURE
{
}

// -----------------------------------------------------------------------------
//
// Default Document Name
//
// -----------------------------------------------------------------------------
//
RESOURCE TBUF r_default_document_name
{
buf="POLA";
}

// -----------------------------------------------------------------------------
//
// Define default menu and CBA key.
//
// -----------------------------------------------------------------------------
//
RESOURCE EIK_APP_INFO
{
menubar = r_menubar;
cba = R_AVKON_SOFTKEYS_OPTIONS_EXIT;
}

//----------------------------------------------------
//
// r_settingslist_setting_item_list
// settings item list for the application
//
//----------------------------------------------------
//
RESOURCE AVKON_SETTING_ITEM_LIST R_POLARLOTUSVISUAL_SETTING_ITEM_LIST
{
flags = EAknSettingItemNumberedStyle;
title = "Configurations";
items =
{
AVKON_SETTING_ITEM
{
identifier = ESpeedSettingItem;
setting_page_resource = r_speed_setting_page;
name = "Speed";
},
AVKON_SETTING_ITEM
{
identifier = EColorSettingItem;
//sen!!setting_page_resource = r_settingslist_player_name_setting_page;
name = "Color change";
//compulsory_ind_string ="*";
}
};
}

// DIFFICULTY
//----------------------------------------------------
//
// r_settingslist_difficulty_setting_page
// difficulty setting page for the setting list
//
//----------------------------------------------------
//
RESOURCE AVKON_SETTING_PAGE r_speed_setting_page
{

hint_text = "Speed";
//label = DIFFICULTY_SETTING_ITEM_TITLE;
type = EAknCtSlider;
editor_resource_id = r_speed_slider;
}

//----------------------------------------------------
//
// r_settingslist_difficulty_slider
// slider for the difficulty setting page
//
//----------------------------------------------------
//
RESOURCE SLIDER r_speed_slider
{
layout = EAknSettingsItemSliderLayout;
minvalue = 0;
maxvalue = 10;
step = 1;
valuetype = EAknSliderValueBareFigure;
minlabel = "Min";
maxlabel = "Max";
}

// -----------------------------------------------------------------------------
//
// r_menubar
// Main menubar
//
// -----------------------------------------------------------------------------
//
RESOURCE MENU_BAR r_menubar
{
titles =
{
MENU_TITLE { menu_pane = r_menu; }
};
}

// -----------------------------------------------------------------------------
//
// r_menu
// Menu for "Options"
//
// -----------------------------------------------------------------------------
//
RESOURCE MENU_PANE r_menu
{
items =
{
// added the new Options menu command here

MENU_ITEM
{
command = EHelp;
txt = "Instructions";
cascade=r_submenu;
},
MENU_ITEM
{
command = EGUIScreensaverCmdWatch;
txt = "Watch in fullscreen";
},

MENU_ITEM
{
command = EGUIScreensaverCmdSet;
txt = "Configure";
},

MENU_ITEM
{
command = EAbout;
txt = qtn_about;//where??
},
MENU_ITEM
{
command = EAknSoftkeyExit;
txt = qtn_exit;
}



};
}

RESOURCE MENU_PANE r_submenu
{
items =
{
// added the new Options menu command here

MENU_ITEM
{
command = EGUIScreensaverCmdActivate;
txt = "Activate it as a screensaver";

},
MENU_ITEM
{
command = EGUIScreensaverCmdStartTime;
txt = "Power saver time out";
},

MENU_ITEM
{
command = EGUIScreensaverCmdDeactivate;
txt = "Deactivate it as a screensaver";
}




};
}
// -----------------------------------------------------------------------------
//
// About dialog resource.
//
// -----------------------------------------------------------------------------
//
RESOURCE DIALOG r_about_query_dialog
{
flags = EGeneralQueryFlags | EEikDialogFlagNoBorder | EEikDialogFlagNoShadow;
buttons = R_AVKON_SOFTKEYS_OK_EMPTY;
items=
{
DLG_LINE
{
type = EAknCtPopupHeadingPane;
id = EAknMessageQueryHeaderId;
itemflags = EEikDlgItemNonFocusing;
control = AVKON_HEADING
{
};
},
DLG_LINE
{
type = EAknCtMessageQuery;
id = EAknMessageQueryContentId;
control = AVKON_MESSAGE_QUERY
{
};
}
};
}

// -----------------------------------------------------------------------------
//
// Resources for messages.
//
// -----------------------------------------------------------------------------
//
RESOURCE TBUF32 r_caption_string { buf=qtn_caption_string; }
RESOURCE TBUF32 r_about_dialog_title { buf=qtn_about_dialog_title; }
RESOURCE TBUF r_about_dialog_text { buf=qtn_about_dialog_text; }
RESOURCE TBUF r_command1_text { buf=qtn_command1_text; }

// ----------------------------------------------------------------------------
//
// r_localisable_app_info
//
// ----------------------------------------------------------------------------
//
RESOURCE LOCALISABLE_APP_INFO r_localisable_app_info
{
short_caption = qtn_caption_string;
caption_and_icon =
CAPTION_AND_ICON_INFO
{
caption = qtn_caption_string;

number_of_icons = 1;
icon_file = "\\resource\\apps\\PolarLotusVisual_0xE00D5023.mif";
};
}

// End of File


Sat, 2009-06-13 17:33
Joined: 2003-12-05
Forum posts: 822

You must write the resource names in small letters, not capital lettes. The resource compiler generates the rsg file and there the resource id's are in caps. Then you use those in code.
Also,
* Have you checked if the resource compilation succeeds? If not, the rsg file is not generated.
* Have you included the rsg file with < and >, not with " and "?

Sun, 2009-06-14 19:00
Joined: 2008-02-12
Forum posts: 77

Thanks, that solved the problem with the compliation! Small characters in rss file and big in cpp file, I will remember that.

But I can still not run it in the emulator because it crashes before the program starts in the emulator. Do you know why this happens? Since it's caused by the iSettingItemList->ConstructFromResourceL(R_POLARLOTUSVISUAL_SETTING_ITEM_LIST);
call, maybe it's because the resource is constructed at the wrong place in the application?

Mon, 2009-06-15 18:25
Joined: 2008-02-12
Forum posts: 77

I managed to get this towork now....


copyright 2003-2009 NewLC SARL