FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Class INI not working on Vista ?
Posts: 838
Joined: Fri Feb 10, 2006 12:14 PM
Class INI not working on Vista ?
Posted: Mon Nov 03, 2008 05:03 PM

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

Antonio

Regards

Antonio H Ferreira
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
INI-Files
Posted: Mon Nov 03, 2008 08:28 PM
Hello,

I use VISTA and there are no problems.

A sample :

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 :-)
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.
Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
Class INI not working on Vista ?
Posted: Mon Nov 03, 2008 09: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

Posts: 838
Joined: Fri Feb 10, 2006 12:14 PM
Class INI not working on Vista ?
Posted: Tue Nov 04, 2008 09: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

Regards

Antonio H Ferreira
Posts: 274
Joined: Fri Apr 04, 2008 01:25 PM
Class INI not working on Vista ?
Posted: Tue Nov 04, 2008 09: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
Posts: 838
Joined: Fri Feb 10, 2006 12:14 PM
Class INI not working on Vista ?
Posted: Tue Nov 04, 2008 11:02 AM

The problem is with the INI file in a Netware server + Vista. On Vista works ok.

Regards

Antonio H Ferreira
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Class INI not working on Vista ?
Posted: 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
Posts: 838
Joined: Fri Feb 10, 2006 12:14 PM
Class INI not working on Vista ?
Posted: Tue Nov 04, 2008 03: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

Regards

Antonio H Ferreira
Posts: 838
Joined: Fri Feb 10, 2006 12:14 PM
Class INI not working on Vista ?
Posted: Tue Nov 04, 2008 04:19 PM

This problem only occurs in a Netware file server.

If the ini file is on the Vista workstation it works ok.

Regards

Antonio H Ferreira
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Class INI not working on Vista ?
Posted: Tue Nov 04, 2008 06: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
Posts: 838
Joined: Fri Feb 10, 2006 12:14 PM
Class INI not working on Vista ?
Posted: Tue Nov 04, 2008 08:18 PM

Thanks Antonio,

I'm going to try xHarvour ini functions instead.

Keep my fingers crossed.

Antonio

Regards

Antonio H Ferreira

Continue the discussion