Class INI not working on Vista ?

Class INI not working on Vista ?

Postby AHF » Mon Nov 03, 2008 5:03 pm

I suspect that the class INI is not working o Vista.
Any issues on this ?

Antonio
AHF
 
Posts: 838
Joined: Fri Feb 10, 2006 12:14 pm

INI-Files

Postby ukoenig » Mon Nov 03, 2008 8:28 pm

Hello,

I use VISTA and there are no problems.

A sample :

Code: Select all  Expand view

c_dir   := GetModuleFilename(GetInstance(),"MYPROG.EXE" + CHR(0), 255)
c_path   := left ( c_dir, rat( "\", c_dir) -1 )

// ----------  READ FROM INI ----------------

IF !FILE ( c_path + "\Info.ini" )
   SAVE_INI("N")
ENDIF
IF FILE ( c_path + "\Infobar.ini" )
   INI oIni FILE c_path + "\Info.ini"
      GET nDATE SECTION "Main" ENTRY "DATESET" OF oIni  DEFAULT "5"
      GET nINSERT SECTION "Main" ENTRY "WRITESET"  OF oIni DEFAULT "1"
      GET nORIENT SECTION "Main" ENTRY "ORIENTAT" OF oIni DEFAULT "1"
   ENDINI
ENDIF

// ---------- SAVE TO INI --------------

FUNCTION SAVE_INI(message)
local cIni := c_path + "\Info.ini"

IF WritePProString( "Main", "DATESET", ALLTRIM(STR(e_RADIO1)),  cIni ) = .F.
   MsgAlert("Not possible, to write in  INI-File", "INI-File")
   RETURN( NIL )
ENDIF
IF WritePProString( "Main", "WRITESET", ALLTRIM(STR(e_INSERT)),  cIni ) = .F.
   MsgAlert("Not possible, to write in  INI-File", "INI-File")
   RETURN( NIL )
ENDIF
IF WritePProString( "Main", "ORIENTAT", ALLTRIM(STR(e_ORIENT)),  cIni ) = .F.
   MsgAlert("Not possible, to write in  INI-File", "INI-File")
   RETURN( NIL )
ENDIF

IF FILE(cIni)
   cOpen := "Notepad.exe " + cIni
   WinExec( "&cOpen" )
ELSE
   MsgAlert( "Couldn't create File : " + cIni + " !!!","ATTENTION")
ENDIF

RETURN( NIL )



Regards
Uwe :lol:
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Postby Otto » Mon Nov 03, 2008 9:23 pm

Please look at this thread:

http://fivetechsoft.com/forums/viewtopi ... ight=vista

I found out that this only happens if the INI file has setup or install in the name.

Regards,
Otto
User avatar
Otto
 
Posts: 6328
Joined: Fri Oct 07, 2005 7:07 pm

Postby AHF » Tue Nov 04, 2008 9:13 am

It's not the case.
By the way this problem happens with an app build with :

Xbuilder March 2006 + FWH March 2006

With all other windows ver running very stable for several years.

Any idea ? Are these versions incompatible with Vista ?

Antonio
AHF
 
Posts: 838
Joined: Fri Feb 10, 2006 12:14 pm

Postby gkuhnert » Tue Nov 04, 2008 9:20 am

Antonio,

as far as I know, Vista doesn't allow in standard settings changes to be made in the program files folder. So if your application is installed to the standard program files folder, you have to put your ini file to the general or specific user-folder windows is providing for such purposes. Another solution might be to install the application just into another folder ;)
Best Regards,

Gilbert Kuhnert
CTO Software GmbH
http://www.ctosoftware.de
User avatar
gkuhnert
 
Posts: 274
Joined: Fri Apr 04, 2008 1:25 pm
Location: Aachen - Germany // Kerkrade - Netherlands

Postby AHF » Tue Nov 04, 2008 11:02 am

The problem is with the INI file in a Netware server + Vista. On Vista works ok.
AHF
 
Posts: 838
Joined: Fri Feb 10, 2006 12:14 pm

Postby Antonio Linares » Tue Nov 04, 2008 12:07 pm

Antonio,

Is it a private INI file ?

I mean, is it a standalone INI file ? If yes, can you check that it exists using File() or read it using MemoRead() ?
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42080
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby AHF » Tue Nov 04, 2008 3:42 pm

The ini file it's "personal each user has it's own ini file.
File exists (file() tested) and it can be read by memoread().

Any Ideas.

Antonio
AHF
 
Posts: 838
Joined: Fri Feb 10, 2006 12:14 pm

Postby AHF » Tue Nov 04, 2008 4:19 pm

This problem only occurs in a Netware file server.

If the ini file is on the Vista workstation it works ok.
AHF
 
Posts: 838
Joined: Fri Feb 10, 2006 12:14 pm

Postby Antonio Linares » Tue Nov 04, 2008 6:05 pm

Antonio,

If you can read it using MemoRead() then you may analize it from your code without using the INI functions.

At least, you can use that as a workaround.
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42080
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby AHF » Tue Nov 04, 2008 8:18 pm

Thanks Antonio,

I'm going to try xHarvour ini functions instead.

Keep my fingers crossed.

Antonio
AHF
 
Posts: 838
Joined: Fri Feb 10, 2006 12:14 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 62 guests