VBcoders Browse New Submit Contact Sign In

No account? Register free

Forgot password?

16 and 32 bit functions to create

VB Qaid  (3 Submissions)   Files/File Controls/Input/Output   Visual Basic 3.0   Unknown Difficulty   Wed 3rd February 2021

16 AND 32 bit functions to read/write ini files--very useful!

API Declarations
'****************************************************
'* INI_sm.BAS *
'****************************************************
Option Explicit
#If Win16 Then
Declare Function WritePrivateProfileString Lib "Kernel" (ByVal AppName As String, ByVal KeyName As String, ByVal NewString As String, ByVal filename As String) As Integer
Declare Function GetPrivateProfileString Lib "Kernel" Alias "GetPrivateProfilestring" (ByVal AppName As String, ByVal KeyName As Any, ByVal default As String, ByVal ReturnedString As String, ByVal MAXSIZE As Integer, ByVal filename As String) As Integer
#Else
' NOTE: The lpKeyName argument for GetProfileString, WriteProfileString,
' GetPrivateProfileString, and WritePrivateProfileString can be either
' a string or NULL. This is why the argument is defined as "As Any".
' For example, to pass a string specify ByVal "wallpaper"
' To pass NULL specify ByVal 0&
' You can also pass NULL for the lpString argument for WriteProfileString
' and WritePrivateProfileString
' Below it has been changed to a string due to the ability to use vbNullString
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 WritePrivateProfileString Lib "kernel32" Alias "WritePrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As String, ByVal lpString As Any, ByVal lpFileName As String) As Long
#End If

Rate 16 and 32 bit functions to create (26(26 Vote))
16 and 32 bit functions to create.bas

16 and 32 bit functions to create Comments

No comments yet — be the first to post one!

Post a Comment

0/1000 characters