Protected types can only be decalred inside of a class
I am using VS2005Pro Beta2 to modify a program originally written in VB2005 Express Beta2. In the Express version it compiles just fine, but when I try to compile it in VS2005 then I constantly get an error saying "Protected types can only be decalred inside of a class". The error is found in the Application.Designer.vb file which is auto-generated.
So my question is: Is this a general problem with VS2005 or is it me? I'm also having troubles compiling other projects so I think there's a bigger problem with VS2005. Is there a solution to this problem?
Namespace My
'NOTE: This file is auto-generated, do not modify it directly. To make changes,
' or if you encounter build errors in this file, go to the Project Designer
' (go to project properties or double-click on the My Project node in the
' Solution Explorer), and make changes on the Application tab.
'
Partial Protected Class MyApplication
<Global.System.Diagnostics.DebuggerStepThrough()> _
Public Sub New()
MyBase.New(Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows)
Me.IsSingleInstance = true
Me.EnableVisualStyles = true
Me.SaveMySettingsOnExit = true
Me.ShutDownStyle = Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterAllFormsClose
End Sub
<Global.System.Diagnostics.DebuggerStepThrough()> _
Protected Overrides Sub OnCreateMainForm()
Me.MainForm = Global.OfficeAdministrator.frmLogin
End Sub
<Global.System.Diagnostics.DebuggerStepThrough()> _
Protected Overrides Sub OnCreateSplashScreen()
Me.SplashScreen = Global.OfficeAdministrator.sscAdmin
End Sub
End Class
End Namespace
JJRDK
[1744 byte] By [
jjrdk] at [2007-12-16]
Here's the code generated from my copy of vb 2005 b2
Note, if you changed the name of your app or form1 or splashscreen, remember to rename the variables
Namespace
My
'NOTE: This file is auto-generated; do not modify it directly. To make changes,
' or if you encounter build errors in this file, go to the Project Designer
' (go to Project Properties or double-click the My Project node in
' Solution Explorer), and make changes on the Application tab.
' Partial Friend Class MyApplication
<Global.System.Diagnostics.DebuggerStepThrough()> _
Public Sub New()
MyBase.New(Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows)
Me.IsSingleInstance = false
Me.EnableVisualStyles = true
Me.SaveMySettingsOnExit = true
Me.ShutDownStyle = Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses
End Sub <
Global.System.Diagnostics.DebuggerStepThrough()> _
Protected Overrides Sub OnCreateMainForm()
Me.MainForm = Global.WindowsApplication1.Form1
End Sub <
Global.System.Diagnostics.DebuggerStepThrough()> _
Protected Overrides Sub OnCreateSplashScreen()
Me.SplashScreen = Global.WindowsApplication1.SplashScreen1
End Sub
End ClassEnd
NamespaceHope this template helps.
Thanks for the code sample. I think it is pretty much like the one I posted, except my variables are changed. I have taken out the splash screen and it goes directly to the first form. The problem now is that since I erased the Form1 and set the frmLogin as the startup form the program insists on starting up in Form1 which it creates as an empty grey form. No login, no access to the rest of the application.
I should probably mention there was no problems running this program through the express edition.
jjrdk