Accessing INI files in VB5 ? 
Author Message
 Accessing INI files in VB5 ?

Hello,

I hope you can help me with the following problem:

I am working with Visual Basic 5.0 Professional Edition.  The question is
how I can access INI files from within my Visual Basic programs (read and
write values) ???

In earlier versions, you could use the GetPrivateProfileString and other
functions from the Kernel, but this doesn't seem to work anymore with VB5
(and kernel32).

I think this is an easy one for you, but I am really desperate, so I would
be very thankful if you can help me...

A fellow-programmer from Belgium,

Frederic Norro



Sun, 09 Apr 2000 03:00:00 GMT  
 Accessing INI files in VB5 ?

Hello,

Get/WritePrivateProfileString() works fine under VB 5.0 for me.  Here are
the declares right out of the API Viewer application:

Declare Function GetPrivateProfileString _
                 Lib "kernel32" _
                 Alias "GetPrivateProfileStringA" _
                (ByVal lpApplicationName As String, _
                 ByVal lpKeyName As Any, _
                 ByVal lpDefault As String, _
                 ByVal lpReturnedString As String, _
                 ByVal nSize As Long, _
                 ByVal lpFileName As String) As Long

Declare Function WritePrivateProfileString _
                 Lib "kernel32" _
                 Alias "WritePrivateProfileStringA" _
                (ByVal lpApplicationName As String, _
                 ByVal lpKeyName As Any, _
                 ByVal lpString As Any, _
                 ByVal lpFileName As String) As Long

I hope this helps,

--

Larry R. Tubbs Jr., MCPS, MCSD
Silverleaf Resorts Inc, NYSE: SVR

Quote:

>Hello,

>I hope you can help me with the following problem:

>I am working with Visual Basic 5.0 Professional Edition.  The question is
>how I can access INI files from within my Visual Basic programs (read and
>write values) ???

>In earlier versions, you could use the GetPrivateProfileString and other
>functions from the Kernel, but this doesn't seem to work anymore with VB5
>(and kernel32).

>I think this is an easy one for you, but I am really desperate, so I would
>be very thankful if you can help me...

>A fellow-programmer from Belgium,

>Frederic Norro



Mon, 10 Apr 2000 03:00:00 GMT  
 Accessing INI files in VB5 ?

Quote:

>In earlier versions, you could use the GetPrivateProfileString and other
>functions from the Kernel, but this doesn't seem to work anymore with VB5
>(and kernel32).

The GetPrivateProfileString and WritePrivateProfileString should still
work with VB5.  Make sure you have the correct declarations by using
the API Viewer.

---------------------
John Tabor

http://userweb.idsonline.com/jtabor



Tue, 11 Apr 2000 03:00:00 GMT  
 Accessing INI files in VB5 ?

Quote:


>>In earlier versions, you could use the GetPrivateProfileString and other
>>functions from the Kernel, but this doesn't seem to work anymore with VB5
>>(and kernel32).
>The GetPrivateProfileString and WritePrivateProfileString should still
>work with VB5.  Make sure you have the correct declarations by using
>the API Viewer.

They certainly DO work :

Declare Function GetPrivateProfileString Lib "Kernel32" Alias _
        "GetPrivateProfileStringA"
        (ByVal lpApplicationName As String, ByVal lpKeyName As Any, _
         ByVal lpDefault As String, ByVal lpReturnedString As String, _
         ByVal nSize As Long, ByVal lpFileName As String) As Long

Declare Function WritePrivateProfileString Lib "Kernel32" Alias _
        "WritePrivateProfileStringA" _
        (ByVal lpApplicationName As String, ByVal lpKeyName As Any, _
        ByVal lpString As Any, ByVal lpFileName As String) As Long

Roger

If you need to e-mail me directly, please remove the "9" from my e-mail address. Thank you.



Fri, 14 Apr 2000 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Ini File access in VB5?

2. Reading and writing to an .ini file in VB5

3. Reading strings from INI files in VB5

4. How to use INI-Files in VB5.0

5. ini files in vb5

6. Read/Write to INI files in VB5

7. How to create .ini file in Vb5???

8. VB3-->VB5: Need Help With Declared Ini File Functions

9. .INI files with VB5

10. .INI files with VB5

11. INI Files with VB5

12. Read/Write to INI files in VB5???

 

 
Powered by phpBB® Forum Software