Thread View: comp.lang.basic.visual
7 messages
7 total messages
Started by Javier Calder�n
Fri, 18 Apr 1997 00:00
HELP !!! ... How i can read INI files in VB4 ....
Author: Javier Calder�n
Date: Fri, 18 Apr 1997 00:00
Date: Fri, 18 Apr 1997 00:00
15 lines
1171 bytes
1171 bytes
Hi ! I need help !!! In VB3 i use the getProfile function to read .INI files but in VB4 it reads only one time and when there�s some change in the INI file and i try read the .INI file again, I CAN�T SEE THE CHANGES. Someone knows another way to read .INI files (and changes over these files) in VB4 over Win 3, Win 95 and WinNT 4.0 WS. Your help would be much appreciated. Thanx. Javier Calderon jcaldero@ctc-mundo.net
Re: HELP !!! ... How i can read INI files in VB4 ....
Author: Robert Klujeff
Date: Sun, 20 Apr 1997 00:00
Date: Sun, 20 Apr 1997 00:00
26 lines
1413 bytes
1413 bytes
use getsetting and savesetting - it's VERY easy. Robert Klujeff rklujeff@post3.tele.dk Javier Calder�n <jcaldero@ctc-mundo.net> wrote in article <01bc4bb2$2eb66ae0$62011bc8@tiburon>... > Hi ! > > I need help !!! > In VB3 i use the getProfile function to read .INI files but in VB4 it reads > only one time and when there�s some change in the INI file and i try read > the .INI file again, I CAN�T SEE THE CHANGES. > Someone knows another way to read .INI files (and changes over these files) > in VB4 over Win 3, Win 95 and WinNT 4.0 WS. > Your help would be much appreciated. > > Thanx. > > Javier Calderon > jcaldero@ctc-mundo.net > >
Re: HELP !!! ... How I can read INI files in VB4 ....
Author: Jere
Date: Tue, 22 Apr 1997 00:00
Date: Tue, 22 Apr 1997 00:00
32 lines
1736 bytes
1736 bytes
I read ini files in VB. 4 the same way I did in VB. 3 but I believe the string length parameter changes from integer to long if you are using 32 bit and the API name has a slight change. That is there is a 32 bit and a 16 bit version of the API. Look in your object browser. Robert Klujeff <rklujeff@post3.tele.dk> wrote in article <01bc4d86$437db700$0990b6c2@ROK.JDC>... > use getsetting and savesetting - it's VERY easy. > > Robert Klujeff > rklujeff@post3.tele.dk > > Javier Calder�n <jcaldero@ctc-mundo.net> wrote in article > <01bc4bb2$2eb66ae0$62011bc8@tiburon>... > > Hi ! > > > > I need help !!! > > In VB3 i use the getProfile function to read .INI files but in VB4 it > reads > > only one time and when there�s some change in the INI file and i try read > > the .INI file again, I CAN�T SEE THE CHANGES. > > Thanx. > > > > Javier Calderon > > jcaldero@ctc-mundo.net > > > > >
Re: HELP !!! ... How i can read INI files in VB4 ....
Author: Bart Lateur
Date: Tue, 22 Apr 1997 00:00
Date: Tue, 22 Apr 1997 00:00
31 lines
1834 bytes
1834 bytes
"Javier Calder�n" <jcaldero@ctc-mundo.net> wrote:
>In VB3 i use the getProfile function to read .INI files but in VB4 it reads
>only one time and when there�s some change in the INI file and i try read
>the .INI file again, I CAN�T SEE THE CHANGES.
>Someone knows another way to read .INI files (and changes over these files)
>in VB4 over Win 3, Win 95 and WinNT 4.0 WS.
>Your help would be much appreciated.
Have you notified the system that the INI file is changed?
This is from the Win3.1 SDK HLP file for WritePrivateProfileString:
To improve performance, Windows keeps a cached version of the
most-recently accessed initialization file. If that filename is
specified and the other three parameters are NULL, Windows
flushes the cache.
I bet this will solve your problem.
There's a similar comment for WriteProfileString.
Note: a NULL is really a zero as long (0&). You may need to change the
declaration to get this to work ("Byval ... as any" should do).
Gent (Ghent, Gand),
Belgium,
Europe,
3rd planet from the sun.
Re: HELP !!! ... How i can read INI files in VB4 ....
Author: James Chambers
Date: Sat, 26 Apr 1997 00:00
Date: Sat, 26 Apr 1997 00:00
17 lines
1518 bytes
1518 bytes
In article <01bc4bb2$2eb66ae0$62011bc8@tiburon>, jcaldero@ctc-mundo.net says... > >Hi ! > >I need help !!! >In VB3 i use the getProfile function to read .INI files but in VB4 it reads >only one time and when there�s some change in the INI file and i try read >the .INI file again, I CAN�T SEE THE CHANGES. >Someone knows another way to read .INI files (and changes over these files) >in VB4 over Win 3, Win 95 and WinNT 4.0 WS. >Your help would be much appreciated. I have used getsetting and savesetting in VB 4.0 32 bit and 16 bit with very good results. Let me know if you need some code examples. In 32 bit, it writes to the system registry as opposed to the .INI. I am not sure if this can be changed or not.
Re: HELP !!! ... How i can read INI files in VB4 ....
Author: Mark Wilson
Date: Mon, 28 Apr 1997 00:00
Date: Mon, 28 Apr 1997 00:00
71 lines
3572 bytes
3572 bytes
Use the following API calls:
Copy it from here and paste into a moudle in the declare area. NOTE:
These are 16 bit calls, but the 32 bit are not too different. Us the VB
API text viewer which is in 4.0 32bit and VB 5.0 to find the 32bit
versions.
'windows API function to find the windows directory
Declare Function GetWindowsDirectory Lib "Kernel" (ByVal lpBuffer As
String, ByVal nSize As Integer) As Integer
'windows API function to get from the WIN.INI
Declare Function GetProfileString Lib "Kernel" (ByVal lpAppName As
String, ByVal lpKeyName As Any, ByVal lpDefault As String, ByVal
lpReturnedString As String, ByVal nSize As Integer) As Integer
'windows API function to write to the WIN.INI
Declare Function WriteProfileString Lib "Kernel" (ByVal
lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpString As
Any) As Integer
'windows API function to get from your own INI
Declare Function GetPrivateProfileString Lib "Kernel" (ByVal
lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpDefault As
String, ByVal lpReturnedString As String, ByVal nSize As Integer, ByVal
lpFileName As String) As Integer
'windows API function to write to your own INI
Declare Function WritePrivateProfileString Lib "Kernel" (ByVal
lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpString As
Any, ByVal lplFileName As String) As Integer
Here is how I used it. NOTE the GET and WRITE parts:
ReturnedSize = GetPrivateProfileString("PathToDataBases", "PROJECT",
DefaultString, ReturnedString, 255, "Holywood.ini")
ReturnedSize = WritePrivateProfileString("PathToDataBases", "PROJECT",
"J:\PROJECT\CL_SERV\PROJECT.MDB", "Holywood.ini")
--
Check out Virtual Enterprises:
http://dspace.dial.pipex.com/virtual/index.htm
FREE technology Ezine!! A dynamic place where business users and
software developers are meeting.
James Chambers wrote:
>
> In article <01bc4bb2$2eb66ae0$62011bc8@tiburon>, jcaldero@ctc-mundo.net says...
> >
> >Hi !
> >
> >I need help !!!
> >In VB3 i use the getProfile function to read .INI files but in VB4 it reads
> >only one time and when there�s some change in the INI file and i try read
> >the .INI file again, I CAN�T SEE THE CHANGES.
> >Someone knows another way to read .INI files (and changes over these files)
> >in VB4 over Win 3, Win 95 and WinNT 4.0 WS.
> >Your help would be much appreciated.
>
> I have used getsetting and savesetting in VB 4.0 32 bit and 16 bit with
> very good results. Let me know if you need some code examples. In 32 bit, it
> writes to the system registry as opposed to the .INI. I am not sure if this
> can be changed or not.
Re: HELP !!! ... How i can read INI files in VB4 ....
Author: Raymond J Hastie
Date: Wed, 30 Apr 1997 00:00
Date: Wed, 30 Apr 1997 00:00
61 lines
3022 bytes
3022 bytes
Check out the following API functions:
Declare Function GetPrivateProfileString Lib "Kernel32" Alias
"GetPrivateProfileStringA" _
(ByVal lpApplicationName As String, ByVal lpKeyName As
String, _
ByVal lpDefault As String, ByVal lpReturnedString As
String, _
ByVal nSize As Long, ByVal lpFileName As String) As Long
Declare Function GetPrivateProfileInt Lib "Kernel32" Alias
"GetPrivateProfileIntA" _
(ByVal lpApplicationName As String, ByVal lpKeyName As
String, _
ByVal nDefault As Long, ByVal lpFileName As String) As
Long
Declare Function WritePrivateProfileString Lib "Kernel32" Alias
"WritePrivateProfileStringA" _
(ByVal lpApplicationName As String, ByVal lpKeyName As
String, _
ByVal lpString As Any, ByVal lpFileName As String) As Long
They require a tiny bit of gyrations to work, but they enable the use of
ini files in VB4 32
Hope hat helps,
~Ray
_____________________________________________________________________
Endless Knot Enterprises
Custom Computer Solution Developers
http://www.xtalwind.net/~endlessknot
_____________________________________________________________________
James Chambers <nxs@mis.net> wrote in article
<5jtco1$757$1@netnews.mis.net>...
> In article <01bc4bb2$2eb66ae0$62011bc8@tiburon>, jcaldero@ctc-mundo.net
says...
> >
> >Hi !
> >
> >I need help !!!
> >In VB3 i use the getProfile function to read .INI files but in VB4 it
reads
> >only one time and when there�s some change in the INI file and i try
read
> >the .INI file again, I CAN�T SEE THE CHANGES.
> >Someone knows another way to read .INI files (and changes over these
files)
> >in VB4 over Win 3, Win 95 and WinNT 4.0 WS.
> >Your help would be much appreciated.
>
> I have used getsetting and savesetting in VB 4.0 32 bit and 16 bit with
> very good results. Let me know if you need some code examples. In 32
bit, it
> writes to the system registry as opposed to the .INI. I am not sure if
this
> can be changed or not.
>
>
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads