INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Inifile ReadString in XE4

Inifile ReadString in XE4

(OP)
Hi,

I am moving a project from Delphi 7 to XE4 and compilation appeared fine. I have XE4 installed on Windows 7 and building as a Win32 application, the program appears to work fine on that machine and no issues (I have Delphi 7 on a Vista machine.)

When I copy the program to Vista I get problems. The startup of the program is supposed to read an ini file, gets the filepath of a logo and displays on screen, this simply does not work and no custom logo is displayed. This works fine on XE4/Win7 but on Vista no luck. When I changed to XE4 I did change all AnsiString to String in the code, but since the issue is at the start of execution not much is stored into variables I declared so not sure if that would cause issue.

This is my basic code which compiles without issue in both XE4 and D7 but will not display in Vista if built in Win7/XE4:

CODE --> delphi

Var
Gbl_logo : string;

Inifile:=tinifile.create(extractfilepath(application.exename)+’settings.ini’;
Gbl_logo := inifile.readstring(‘Settings’,’Logo’,’’);
If trim(Gbl_logo) <> ‘’ then
Begin
  If FileExists(Gbl_logo) then
  Begin
    Imglogo.picture.loadfromfile(gbl_logo);
  end;
End; 

Example paths of my logo are d:\custom.jpg and c:\programming picture\test.jpg.

Thank you in advance to any suggestions.

RE: Inifile ReadString in XE4

(OP)
Just to add when I do showmessage the dialog box in Win7 shows for example:

c:\projects\software example logo code\logo.jpg

When run in Vista I get:

c:\projects\software example logo
code\logo.jpg

It looks like a line break appears from nowhere, I checked the ini file and no line breaks...

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close