Reputation: 35
I migrated VB6 code to Vb.net and I am getting
" 'App' is not declared. It may be inaccessible due to its protection level".
below is the code
Private Declare Function WinHelp Lib "user32" Alias "WinHelpA" (ByVal hWnd As Integer, ByVal lpHelpFile As String, ByVal wCommand As Integer, ByVal dwData As Integer) As Integer
Public Property HelpFile() As String
Get
HelpFile = App.HelpFile
End Get
Set(ByVal Value As String)
App.HelpFile = Value
End Set
End Property
I need help on this.
Upvotes: 1
Views: 552
Reputation: 4240
If you are interested in converting a VB6 project to VB.NET, I found this PDF File that has a lot of information about it. However, if you don't mind going through it, I found this on the bottom of the 18th page:
"If the application has a helpfile associated to it then the solution is just to change the
app.helpfile
to the name and path of the helpfile. So for example if the helpfile is called name MyProject.hlp and is stored in thec:\
directory theapp.helpfile
should simply be changed into“c:\MyProject.hlp”
. "
So, just use another variable whose value you are going to set in the class constructor, then use it inside this property instead of App.HelpFile
. Hope it helps.
Upvotes: 1