pocket pc emulator

E

e-mid

hello all,
i am new to programming pocket pc. when i deploy my project on emulator.
first it is loading framework dlls then, launchs my project on emulator. But
i am not able to read files. do i have to load these files into emulator
manually to read them. or is there any other way?
 
M

Maarten Struys, eMVP

What files do you want to read? Can you be a little more specific about
that?
 
E

e-mid

a text file or an xml file, it doesnt matter. i got FileNotFound exception.
file is in the same directory with the exe file. i tried giving the full
path of the file but it does not work too.

thnkz..
 
M

Maarten Struys, eMVP

Is the file deployed to your device? Or do you have it in the same directory
on your develop machine only. If the latter is true, you can deploy it with
your application by adding the particular file to your project: Right click
the project in solution explorer - Add - Add existing item. In the dialog
add the text file you want to use. Make sure its properties are set to
content. Now the text file will be deployed to your device and will be
stored in the same folder as the application and you should be able to open
the file. If you have already done this and it is not working, you might
want to share the code you are using to open the file so we can help you
further.

--
Maarten Struys, eMVP
PTS Software bv

www.opennetcf.org | www.dotnetfordevices.com
 
E

e-mid

Maarten,
i added the xml file to project as you said, and checked to see if the
"content" is set.

then i tried following ;

xr.load("foo.xml");
Console.WriteLine("Loaded..");

but i got FileNotFound exception..

and with full path

xr.load("\projects\smartDeviceApplication1\foo.xml");

this time i got directoryNotFound exception..


what would be wrong here?
 
E

e-mid

ok, i figured it.
xr.Load(@"\Program Files\SmartDeviceApplication1\foo.xml");

has worked..

it seems that "\Program Files\...." is default path for emulator..

thknz...
 
M

Maarten Struys, eMVP

Assuming xr is an object of type XmlDocument you need to use the full path
to access the XML file. Are you sure your project is stored under \projects?
Default would be \Program Files.

Assuming your application is under projects you should specify the path as
one of the following two:

xr.Load(\\projects\\SmartDeviceApplication1\\foo.xml);

or

xr.Load(@"\projects\SmartDeviceApplication1\foo.xml);

--
Maarten Struys, eMVP
PTS Software bv

www.opennetcf.org | www.dotnetfordevices.com


First, what is xr.load? Are you using a
 
E

e-mid

in my pc project is in the:
c:\projects\SmartDeviceApplication1\
so i thought it would be :
\projects\SmartDeviceApplication1\ in the emulator.

but it copies to \Program Files\... by default as you said.

another problem arose then:

xr.save("foo2.xml");

where is foo2 is saved?
 
M

Maarten Struys, eMVP

In this case foo2.xml will be saved in the root of the device. If you use
file explorer on the device - emulator you can find it back under "My
Device". If you want to store the file in a specific folder just specify the
full path in the save method as well.

--
Maarten Struys, eMVP
PTS Software bv

www.opennetcf.org | www.dotnetfordevices.com
 
E

e-mid

thnkz Maarten..

Maarten Struys said:
In this case foo2.xml will be saved in the root of the device. If you use
file explorer on the device - emulator you can find it back under "My
Device". If you want to store the file in a specific folder just specify the
full path in the save method as well.

--
Maarten Struys, eMVP
PTS Software bv

www.opennetcf.org | www.dotnetfordevices.com



path deploy set will able
 
K

Ken Nemelka

Hi

Sorry to jump into the middle of this...

I know the problem has been solved for you guys, but there is something
I cant figure out..

You say to "make sure the content is set".

I cant for the life of me figure out where the "content" thing is set.
It is not in the properties for the "Solution Item". Where is the
"content" set?

thanks in advance
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top