This site is no longer active and is available for archival purposes only. Registration and login is disabled.

Open file problem


Open file problem

Postby patrickwai » Jan 24, 2007 @ 4:53am

I use the follow codes to open file in Symbian 9.1 device (N80):

bool retValue = false;

char filename[100] = {0};

m_pECD->std->StrCpy(filename, m_pECD->dat->currentpath);
m_pECD->std->StrCat(filename, "<FILENAME>.txt");

retValue = m_pECD->file->Open(filename, EFOF_READ);

where "m_pECD" is a "ECD" variable. The file opened successfully in Symbian 7.0 device (3230) but return "0" in N80. Is there any problem about the reference code? I'm using Symbian 6.1 and Symbian 9.1 SDK.

Thanks~
patrickwai
pm Member
 
Posts: 29
Joined: Jan 12, 2007 @ 2:24am


Postby edge » Jan 24, 2007 @ 9:22am

EDGELIB: Cross-platform mobile development at your fingertips
http://www.edgelib.com
User avatar
edge
pm Member
 
Posts: 1180
Joined: Aug 22, 2005 @ 3:42pm
Location: The Netherlands


Postby patrickwai » Jan 24, 2007 @ 9:54am

I'm using a .pkg file and here is the content:

{
&EN

#{"MyCode"},(0xF020789F),1,0,0

%{"Vendor-EN"}
:"Vendor"

[0x101F7961], 0, 0, 0, {"S60ProductID"}

"\Symbian\9.1\S60_3rd\epoc32\release\gcce\urel\MyCode.exe"-"!:\sys\bin\MyCode.exe"
"\Symbian\9.1\S60_3rd\Epoc32\Data\z\resource\apps\MyCode.rsc"-"!:\resource\apps\MyCode.rsc"
"\Symbian\9.1\S60_3rd\Epoc32\Data\z\private\10003a3f\import\apps\MyCode_reg.rsc"-"!:\private\10003a3f\import\apps\MyCode_reg.rsc"
"MyCode_aif.mbm"-"!:\resource\apps\MyCode_aif.mbm"
"..\res\Game.txt"-"!:\system\apps\MyCode\Game.txt"
"..\res\m.dat"-"!:\system\apps\MyCode\m.dat"
"..\res\w.dat"-"!:\system\apps\MyCode\w.dat"
"..\res\u.dat"-"!:\system\apps\MyCode\u.dat"
}

The Game.txt is placed in \res.
patrickwai
pm Member
 
Posts: 29
Joined: Jan 12, 2007 @ 2:24am


Postby edge » Jan 24, 2007 @ 10:11am

Hi Patrick,

The problem is that your textfile is installed in the wrong folder. For Symbian 9, the data files must be installed in a private folder belonging to your application.

Change the installation locations of game.txt, m.dat, w.dat and u.dat. Here is an example where game.txt should be installed:
"..\res\Game.txt"-"!:\private\F020789F\Game.txt"

The folder F020789F is the same as your application UID.
EDGELIB: Cross-platform mobile development at your fingertips
http://www.edgelib.com
User avatar
edge
pm Member
 
Posts: 1180
Joined: Aug 22, 2005 @ 3:42pm
Location: The Netherlands


Return to EDGELIB


Sort


Forum Description

Powerful and affordable C++ middleware solution covering true multi-platform 2D, 3D and network features for Apple iPhone, Windows Mobile, Symbian S60, UIQ, Linux and Windows desktop.

Moderator:

edge

Forum permissions

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

cron