| View previous topic :: View next topic |
| Author |
Message |
Jashk@ Newbie
Joined: 08 Aug 2008 Posts: 2
|
Posted: Fri Aug 08, 2008 12:59 pm Post subject: [VDS6] Accessing INI / XML files (EXE with linked resources) |
|
|
Hi all,
I've created an application in VDS6, and want to distribute it as "integrated executable". Therefore I've added all bitmaps, cursors and an INI (later an XML) file as resource.
All my resources get linked during compilation, but I can't seem to access the contents of the linked INI (and later XML) file.
All works fine in the IDE (but then the required files are in the same folder). So it looks as if VDS doesn't load the INI (or XML) file that is linked, but always tries to load the file from the application dir on disk.
What am I doing wrong, or is this not possible at all?
Rgds,
Jan |
|
| Back to top |
|
 |
vdsalchemist Admin Team

Joined: 23 Oct 2001 Posts: 1448 Location: Florida, USA
|
Posted: Sun Aug 10, 2008 6:47 pm Post subject: |
|
|
It would help if you could post some of your code so that we could see what exactly your trying to do. _________________ Home of
Give VDS a new purpose!
 |
|
| Back to top |
|
 |
Jashk@ Newbie
Joined: 08 Aug 2008 Posts: 2
|
Posted: Sun Aug 10, 2008 9:43 pm Post subject: |
|
|
Hi,
Well, I've put all the text strings in various languages in an XML file (previously I used an .INI file in VDS3.51, and I used one of the sample scripts that came with VDS6 to convert to .XML).
My XML file contains stuff like this:
| Code: |
<01>
<Intro1>This program helps you to test your LCD display.</Intro1>
<IntroDispRes1>Your LCD display is designed to be used in a specific display resolution. We call this the native resolution.</IntroDispRes1>
</01>
|
The node <01> containts all English text. Node <02> contains all French text etc.
Now for the program:
I start off with adding the resources as below. I want all compiled / linked in one single .EXE.
| Code: |
#RESOURCE ADD,BITMAP,titlebar.bmp
#RESOURCE ADD,CURSOR,sq_blk.cur
#RESOURCE ADD,CURSOR,sq_wht.cur
#RESOURCE ADD,CUSTOM,language.xml
|
After I've determined the OS language, and translated this to my own language reference, I store this in %%language, and then open the XML file like this:
| Code: |
XMLDOC CREATE,1
XMLDOC LOADFILE,1,language.xml
%x = @XMLDOC(SEEK,1,"/"%%language)
|
After I've created the dialog and its elements, I display a welcome message, and some of the introduction tex about my application. Like this:
| Code: |
dialog set,msg,@XMLDOC(value,1,Welcome) @XMLDOC(value,1,Intro1)@cr()@cr()@XMLDOC(value,1,instrClickNext) @XMLDOC(value,1,instrClickCancel)
|
And Yes, I did first add a text element to my dialog by the name of 'msg', and all of the XML values are present in my XML file (although I only listed a few above).
This works OK in the IDE, and after compiling / linking, as long as my .EXE resides in the same directory as the separate resource files. If I move the .EXE to an empty directory (let's say c:\test) and run it there, none of the XML content is shown anymore. From the file size (and in the compiler message window) I do see that the file was linked.
The other linked resources (cursors, bitmaps etc) do appear properly by the way.
Hope this makes it a bit more clear.
Rgds,
Jan |
|
| Back to top |
|
 |
|
|
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 vote in polls in this forum You can attach files in this forum You can download files in this forum
|
|