I have a project with a startup (Sub Main) module and two forms. Based on the logic in the Sub Main it calls one of the two forms. The two forms are almost identical. They both make calls into the same INI file using the following code:
Private Declare Auto Function GetPrivateProfi leString Lib "kernel32" _
(ByVal lpAppName As String, _
ByVal lpKeyName As String, _
ByVal lpDefault As String, _
ByVal lpReturnedStrin g As System.Text.Str ingBuilder, _
ByVal lpNsize As Integer, _
ByVal lpFileName As String) As Integer
Howerer, in one of the form’s code windows all of the following variables are underlined and it says their “undeclared. In the other form’s code window everything is fine. I’m lost here. It appears that I have the “Private Declare Auto Function…†at the top of BOTH forms, in the same exact place, right after the “# End Region†line of the “Windows Form Designer Generated Code†section.
lpAppName = LookUp
lpDefault = ""
lpReturnedStrin g = New System.Text.Str ingBuilder(256)
lpNsize = 256
lpFileName = "C:\CPViewer_C\ Controls.ini"
What am I missing here? I have Option Explicit turned “Onâ€. As you can Imagine, if I turn it off, the underscores go away since there is no requirement to declare your variables ahead of time.
Any Ideas,
John
Private Declare Auto Function GetPrivateProfi leString Lib "kernel32" _
(ByVal lpAppName As String, _
ByVal lpKeyName As String, _
ByVal lpDefault As String, _
ByVal lpReturnedStrin g As System.Text.Str ingBuilder, _
ByVal lpNsize As Integer, _
ByVal lpFileName As String) As Integer
Howerer, in one of the form’s code windows all of the following variables are underlined and it says their “undeclared. In the other form’s code window everything is fine. I’m lost here. It appears that I have the “Private Declare Auto Function…†at the top of BOTH forms, in the same exact place, right after the “# End Region†line of the “Windows Form Designer Generated Code†section.
lpAppName = LookUp
lpDefault = ""
lpReturnedStrin g = New System.Text.Str ingBuilder(256)
lpNsize = 256
lpFileName = "C:\CPViewer_C\ Controls.ini"
What am I missing here? I have Option Explicit turned “Onâ€. As you can Imagine, if I turn it off, the underscores go away since there is no requirement to declare your variables ahead of time.
Any Ideas,
John
Comment