J
jcrouse
I'm reading an INI file and all is working fine. However, when I turn Option
Explicit "On" (it's currently "Off"), I get errors. Here is my pertinent
code:
Dim lpAppName As String
Dim lpKeyName As String
Dim lpDefault As String
Dim lpReturnedString As New System.Text.StringBuilder(256)
Dim lpNsize As Integer
Dim lpFileName As String
Private Declare Auto Function GetPrivateProfileString Lib "kernel32" _
(ByVal lpAppName As String, _
ByVal lpKeyName As String, _
ByVal lpDefault As String, _
ByVal lpReturnedString As System.Text.StringBuilder, _
ByVal lpNsize As Integer, _
ByVal lpFileName As String) As Integer
lpAppName = strParentName
lpDefault = ""
lpReturnedString = New System.Text.StringBuilder(256)
lpNsize = 256
lpFileName = Application.StartupPath & "\controls.ini"
lpKeyName = "P1_JOYSTICK_UP"
GetPrivateProfileString(lpAppName, lpKeyName, lpDefault, lpReturnedString,
lpNsize, lpFileName)
If lpReturnedString.ToString() <> "" Then
lbl1.Visible = True
lbl1.Text = lpReturnedString.ToString()
End If
It doesn't like the lpReturnedString parameter in the
GetPrivateProfileString function(not sure if the verbage is correct there).
What do I need to do to turn Option Strict "On" or should I not worry about
it?
Thanks,
John
Explicit "On" (it's currently "Off"), I get errors. Here is my pertinent
code:
Dim lpAppName As String
Dim lpKeyName As String
Dim lpDefault As String
Dim lpReturnedString As New System.Text.StringBuilder(256)
Dim lpNsize As Integer
Dim lpFileName As String
Private Declare Auto Function GetPrivateProfileString Lib "kernel32" _
(ByVal lpAppName As String, _
ByVal lpKeyName As String, _
ByVal lpDefault As String, _
ByVal lpReturnedString As System.Text.StringBuilder, _
ByVal lpNsize As Integer, _
ByVal lpFileName As String) As Integer
lpAppName = strParentName
lpDefault = ""
lpReturnedString = New System.Text.StringBuilder(256)
lpNsize = 256
lpFileName = Application.StartupPath & "\controls.ini"
lpKeyName = "P1_JOYSTICK_UP"
GetPrivateProfileString(lpAppName, lpKeyName, lpDefault, lpReturnedString,
lpNsize, lpFileName)
If lpReturnedString.ToString() <> "" Then
lbl1.Visible = True
lbl1.Text = lpReturnedString.ToString()
End If
It doesn't like the lpReturnedString parameter in the
GetPrivateProfileString function(not sure if the verbage is correct there).
What do I need to do to turn Option Strict "On" or should I not worry about
it?
Thanks,
John