MissingManifest Error in VB

G

Guest

Hi everyboby,
I'm trying to make an appz with multilanguage and I've foud an example in C#
(WorldClock).
I've revritten in VB but I get a MissingManifestError. Could someone help me?
Thanks in advance..

Gizmo

Here the code:

Imports System.Globalization

Public Class Form1
Inherits System.Windows.Forms.Form
Friend WithEvents Label1 As System.Windows.Forms.Label
Friend WithEvents MainMenu1 As System.Windows.Forms.MainMenu

Dim rm As System.Resources.ResourceManager
Dim uici As System.Globalization.CultureInfo

#Region " Windows Form Designer generated code "

Public Sub New()
MyBase.New()

'This call is required by the Windows Form Designer.
InitializeComponent()

'Add any initialization after the InitializeComponent() call
rm = New
System.Resources.ResourceManager("MultiLanguage.Resources.strings",
GetType(Form1).Assembly)
uici =
CType(System.Globalization.CultureInfo.CurrentUICulture.Clone, CultureInfo)

LoadResources()

End Sub

'Form overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
MyBase.Dispose(disposing)
End Sub

'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
Friend WithEvents MenuItem1 As System.Windows.Forms.MenuItem
Friend WithEvents MenuItem2 As System.Windows.Forms.MenuItem
Friend WithEvents MenuItem3 As System.Windows.Forms.MenuItem
Private Sub InitializeComponent()
Me.MainMenu1 = New System.Windows.Forms.MainMenu
Me.Label1 = New System.Windows.Forms.Label
Me.MenuItem1 = New System.Windows.Forms.MenuItem
Me.MenuItem2 = New System.Windows.Forms.MenuItem
Me.MenuItem3 = New System.Windows.Forms.MenuItem
'
'MainMenu1
'
Me.MainMenu1.MenuItems.Add(Me.MenuItem1)
'
'Label1
'
Me.Label1.Location = New System.Drawing.Point(24, 40)
Me.Label1.Text = "Label1"
'
'MenuItem1
'
Me.MenuItem1.MenuItems.Add(Me.MenuItem2)
Me.MenuItem1.MenuItems.Add(Me.MenuItem3)
Me.MenuItem1.Text = "Lingua"
'
'MenuItem2
'
Me.MenuItem2.Text = "Inglese"
'
'MenuItem3
'
Me.MenuItem3.Text = "Italiano"
'
'Form1
'
Me.Controls.Add(Me.Label1)
Me.Menu = Me.MainMenu1
Me.Text = "Form1"

End Sub

#End Region

Private Sub MenuItem2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MenuItem2.Click
'Inglese
uici = New CultureInfo("en")
LoadResources()
End Sub

Private Sub MenuItem3_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MenuItem3.Click
'Italiano
uici = New CultureInfo("it")
LoadResources()
End Sub

Private Sub LoadResources()
Label1.Text = rm.GetString("Label1", uici)


End Sub
End Class
 
D

Daniel Moth

Check that:
1. Your project has a file named Resources.strings.resx with its build
action set to embedded resource
2. Your project namespace is MultiLanguage (see in your project properties)

If you are still having issues, add this line at the top of your
LoadResources and stick a breakpoint on it:
Dim s() As String =
[Assembly].GetExecutingAssembly().GetManifestResourceNames() //check in the
debugger for the real names of your resources

For more on localisation:
http://www.danielmoth.com/Blog/2004/12/satellite-assemblies.html

Cheers
Daniel
 
G

Guest

Hi Daniel,
i've checked the 2 points and are correct.
The 2 real name of resources are:
s(0) = MultiLanguage.strings.resources
s(1) = MultiLanguage.Form1.resources

I've tryied to place it on
System.Resources.ResourceManager("MultiLanguage.Resources.strings",
GetType(Form1).Assembly) but still get the error.

What can I do?

Thanks
Gizmo


Daniel Moth said:
Check that:
1. Your project has a file named Resources.strings.resx with its build
action set to embedded resource
2. Your project namespace is MultiLanguage (see in your project properties)

If you are still having issues, add this line at the top of your
LoadResources and stick a breakpoint on it:
Dim s() As String =
[Assembly].GetExecutingAssembly().GetManifestResourceNames() //check in the
debugger for the real names of your resources

For more on localisation:
http://www.danielmoth.com/Blog/2004/12/satellite-assemblies.html

Cheers
Daniel
--
http://www.danielmoth.com/Blog/

Gizmo said:
Hi everyboby,
I'm trying to make an appz with multilanguage and I've foud an example in
C#
(WorldClock).
I've revritten in VB but I get a MissingManifestError. Could someone help
me?
Thanks in advance..

Gizmo

Here the code:

Imports System.Globalization

Public Class Form1
Inherits System.Windows.Forms.Form
Friend WithEvents Label1 As System.Windows.Forms.Label
Friend WithEvents MainMenu1 As System.Windows.Forms.MainMenu

Dim rm As System.Resources.ResourceManager
Dim uici As System.Globalization.CultureInfo

#Region " Windows Form Designer generated code "

Public Sub New()
MyBase.New()

'This call is required by the Windows Form Designer.
InitializeComponent()

'Add any initialization after the InitializeComponent() call
rm = New
System.Resources.ResourceManager("MultiLanguage.Resources.strings",
GetType(Form1).Assembly)
uici =
CType(System.Globalization.CultureInfo.CurrentUICulture.Clone,
CultureInfo)

LoadResources()

End Sub

'Form overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
MyBase.Dispose(disposing)
End Sub

'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
Friend WithEvents MenuItem1 As System.Windows.Forms.MenuItem
Friend WithEvents MenuItem2 As System.Windows.Forms.MenuItem
Friend WithEvents MenuItem3 As System.Windows.Forms.MenuItem
Private Sub InitializeComponent()
Me.MainMenu1 = New System.Windows.Forms.MainMenu
Me.Label1 = New System.Windows.Forms.Label
Me.MenuItem1 = New System.Windows.Forms.MenuItem
Me.MenuItem2 = New System.Windows.Forms.MenuItem
Me.MenuItem3 = New System.Windows.Forms.MenuItem
'
'MainMenu1
'
Me.MainMenu1.MenuItems.Add(Me.MenuItem1)
'
'Label1
'
Me.Label1.Location = New System.Drawing.Point(24, 40)
Me.Label1.Text = "Label1"
'
'MenuItem1
'
Me.MenuItem1.MenuItems.Add(Me.MenuItem2)
Me.MenuItem1.MenuItems.Add(Me.MenuItem3)
Me.MenuItem1.Text = "Lingua"
'
'MenuItem2
'
Me.MenuItem2.Text = "Inglese"
'
'MenuItem3
'
Me.MenuItem3.Text = "Italiano"
'
'Form1
'
Me.Controls.Add(Me.Label1)
Me.Menu = Me.MainMenu1
Me.Text = "Form1"

End Sub

#End Region

Private Sub MenuItem2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MenuItem2.Click
'Inglese
uici = New CultureInfo("en")
LoadResources()
End Sub

Private Sub MenuItem3_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MenuItem3.Click
'Italiano
uici = New CultureInfo("it")
LoadResources()
End Sub

Private Sub LoadResources()
Label1.Text = rm.GetString("Label1", uici)


End Sub
End Class
 
D

Daniel Moth

You have the "strings" and "resources" the wrong way round.

You are getting an exception because you are suing the wrong name. In the
constructor of ResourceManager change the name according to the debug info
and you will get it working.

Give it a go and if you haven't solved it in an hour post back with your
project zipped and I'll have a look at it. You'll get much greater
satisfaction fixing it yourself now that you know the problem is in the
string you are passing to RM.

Cheers
Daniel
--
http://www.danielmoth.com/Blog/

Gizmo said:
Hi Daniel,
i've checked the 2 points and are correct.
The 2 real name of resources are:
s(0) = MultiLanguage.strings.resources
s(1) = MultiLanguage.Form1.resources

I've tryied to place it on
System.Resources.ResourceManager("MultiLanguage.Resources.strings",
GetType(Form1).Assembly) but still get the error.

What can I do?

Thanks
Gizmo


Daniel Moth said:
Check that:
1. Your project has a file named Resources.strings.resx with its build
action set to embedded resource
2. Your project namespace is MultiLanguage (see in your project
properties)

If you are still having issues, add this line at the top of your
LoadResources and stick a breakpoint on it:
Dim s() As String =
[Assembly].GetExecutingAssembly().GetManifestResourceNames() //check in
the
debugger for the real names of your resources

For more on localisation:
http://www.danielmoth.com/Blog/2004/12/satellite-assemblies.html

Cheers
Daniel
--
http://www.danielmoth.com/Blog/

Gizmo said:
Hi everyboby,
I'm trying to make an appz with multilanguage and I've foud an example
in
C#
(WorldClock).
I've revritten in VB but I get a MissingManifestError. Could someone
help
me?
Thanks in advance..

Gizmo

Here the code:

Imports System.Globalization

Public Class Form1
Inherits System.Windows.Forms.Form
Friend WithEvents Label1 As System.Windows.Forms.Label
Friend WithEvents MainMenu1 As System.Windows.Forms.MainMenu

Dim rm As System.Resources.ResourceManager
Dim uici As System.Globalization.CultureInfo

#Region " Windows Form Designer generated code "

Public Sub New()
MyBase.New()

'This call is required by the Windows Form Designer.
InitializeComponent()

'Add any initialization after the InitializeComponent() call
rm = New
System.Resources.ResourceManager("MultiLanguage.Resources.strings",
GetType(Form1).Assembly)
uici =
CType(System.Globalization.CultureInfo.CurrentUICulture.Clone,
CultureInfo)

LoadResources()

End Sub

'Form overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As
Boolean)
MyBase.Dispose(disposing)
End Sub

'NOTE: The following procedure is required by the Windows Form
Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
Friend WithEvents MenuItem1 As System.Windows.Forms.MenuItem
Friend WithEvents MenuItem2 As System.Windows.Forms.MenuItem
Friend WithEvents MenuItem3 As System.Windows.Forms.MenuItem
Private Sub InitializeComponent()
Me.MainMenu1 = New System.Windows.Forms.MainMenu
Me.Label1 = New System.Windows.Forms.Label
Me.MenuItem1 = New System.Windows.Forms.MenuItem
Me.MenuItem2 = New System.Windows.Forms.MenuItem
Me.MenuItem3 = New System.Windows.Forms.MenuItem
'
'MainMenu1
'
Me.MainMenu1.MenuItems.Add(Me.MenuItem1)
'
'Label1
'
Me.Label1.Location = New System.Drawing.Point(24, 40)
Me.Label1.Text = "Label1"
'
'MenuItem1
'
Me.MenuItem1.MenuItems.Add(Me.MenuItem2)
Me.MenuItem1.MenuItems.Add(Me.MenuItem3)
Me.MenuItem1.Text = "Lingua"
'
'MenuItem2
'
Me.MenuItem2.Text = "Inglese"
'
'MenuItem3
'
Me.MenuItem3.Text = "Italiano"
'
'Form1
'
Me.Controls.Add(Me.Label1)
Me.Menu = Me.MainMenu1
Me.Text = "Form1"

End Sub

#End Region

Private Sub MenuItem2_Click(ByVal sender As System.Object, ByVal e
As
System.EventArgs) Handles MenuItem2.Click
'Inglese
uici = New CultureInfo("en")
LoadResources()
End Sub

Private Sub MenuItem3_Click(ByVal sender As System.Object, ByVal e
As
System.EventArgs) Handles MenuItem3.Click
'Italiano
uici = New CultureInfo("it")
LoadResources()
End Sub

Private Sub LoadResources()
Label1.Text = rm.GetString("Label1", uici)


End Sub
End Class
 
G

Guest

:( I've tryed to change the name but no results.. I've send it the project to
your mail..

Thanks

Gizmo

Daniel Moth said:
You have the "strings" and "resources" the wrong way round.

You are getting an exception because you are suing the wrong name. In the
constructor of ResourceManager change the name according to the debug info
and you will get it working.

Give it a go and if you haven't solved it in an hour post back with your
project zipped and I'll have a look at it. You'll get much greater
satisfaction fixing it yourself now that you know the problem is in the
string you are passing to RM.

Cheers
Daniel
--
http://www.danielmoth.com/Blog/

Gizmo said:
Hi Daniel,
i've checked the 2 points and are correct.
The 2 real name of resources are:
s(0) = MultiLanguage.strings.resources
s(1) = MultiLanguage.Form1.resources

I've tryied to place it on
System.Resources.ResourceManager("MultiLanguage.Resources.strings",
GetType(Form1).Assembly) but still get the error.

What can I do?

Thanks
Gizmo


Daniel Moth said:
Check that:
1. Your project has a file named Resources.strings.resx with its build
action set to embedded resource
2. Your project namespace is MultiLanguage (see in your project
properties)

If you are still having issues, add this line at the top of your
LoadResources and stick a breakpoint on it:
Dim s() As String =
[Assembly].GetExecutingAssembly().GetManifestResourceNames() //check in
the
debugger for the real names of your resources

For more on localisation:
http://www.danielmoth.com/Blog/2004/12/satellite-assemblies.html

Cheers
Daniel
--
http://www.danielmoth.com/Blog/

Hi everyboby,
I'm trying to make an appz with multilanguage and I've foud an example
in
C#
(WorldClock).
I've revritten in VB but I get a MissingManifestError. Could someone
help
me?
Thanks in advance..

Gizmo

Here the code:

Imports System.Globalization

Public Class Form1
Inherits System.Windows.Forms.Form
Friend WithEvents Label1 As System.Windows.Forms.Label
Friend WithEvents MainMenu1 As System.Windows.Forms.MainMenu

Dim rm As System.Resources.ResourceManager
Dim uici As System.Globalization.CultureInfo

#Region " Windows Form Designer generated code "

Public Sub New()
MyBase.New()

'This call is required by the Windows Form Designer.
InitializeComponent()

'Add any initialization after the InitializeComponent() call
rm = New
System.Resources.ResourceManager("MultiLanguage.Resources.strings",
GetType(Form1).Assembly)
uici =
CType(System.Globalization.CultureInfo.CurrentUICulture.Clone,
CultureInfo)

LoadResources()

End Sub

'Form overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As
Boolean)
MyBase.Dispose(disposing)
End Sub

'NOTE: The following procedure is required by the Windows Form
Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
Friend WithEvents MenuItem1 As System.Windows.Forms.MenuItem
Friend WithEvents MenuItem2 As System.Windows.Forms.MenuItem
Friend WithEvents MenuItem3 As System.Windows.Forms.MenuItem
Private Sub InitializeComponent()
Me.MainMenu1 = New System.Windows.Forms.MainMenu
Me.Label1 = New System.Windows.Forms.Label
Me.MenuItem1 = New System.Windows.Forms.MenuItem
Me.MenuItem2 = New System.Windows.Forms.MenuItem
Me.MenuItem3 = New System.Windows.Forms.MenuItem
'
'MainMenu1
'
Me.MainMenu1.MenuItems.Add(Me.MenuItem1)
'
'Label1
'
Me.Label1.Location = New System.Drawing.Point(24, 40)
Me.Label1.Text = "Label1"
'
'MenuItem1
'
Me.MenuItem1.MenuItems.Add(Me.MenuItem2)
Me.MenuItem1.MenuItems.Add(Me.MenuItem3)
Me.MenuItem1.Text = "Lingua"
'
'MenuItem2
'
Me.MenuItem2.Text = "Inglese"
'
'MenuItem3
'
Me.MenuItem3.Text = "Italiano"
'
'Form1
'
Me.Controls.Add(Me.Label1)
Me.Menu = Me.MainMenu1
Me.Text = "Form1"

End Sub

#End Region

Private Sub MenuItem2_Click(ByVal sender As System.Object, ByVal e
As
System.EventArgs) Handles MenuItem2.Click
'Inglese
uici = New CultureInfo("en")
LoadResources()
End Sub

Private Sub MenuItem3_Click(ByVal sender As System.Object, ByVal e
As
System.EventArgs) Handles MenuItem3.Click
'Italiano
uici = New CultureInfo("it")
LoadResources()
End Sub

Private Sub LoadResources()
Label1.Text = rm.GetString("Label1", uici)


End Sub
End Class
 
D

Daniel Moth

Please keep all posts (including attachments) to this group.

Change this:
MultiLanguage.Resources.strings
to
MultiLanguage.strings

You could have easily found that yourself, in fact you did. Read your own
post (there is no "Resources" straight after MulitLanguage):
So to answer your question to me in the email: Focus is what I recommend.

Cheers
Daniel
--
http://www.danielmoth.com/Blog/

Gizmo said:
:( I've tryed to change the name but no results.. I've send it the project
to
your mail..

Thanks

Gizmo

Daniel Moth said:
You have the "strings" and "resources" the wrong way round.

You are getting an exception because you are suing the wrong name. In the
constructor of ResourceManager change the name according to the debug
info
and you will get it working.

Give it a go and if you haven't solved it in an hour post back with your
project zipped and I'll have a look at it. You'll get much greater
satisfaction fixing it yourself now that you know the problem is in the
string you are passing to RM.

Cheers
Daniel
--
http://www.danielmoth.com/Blog/

Gizmo said:
Hi Daniel,
i've checked the 2 points and are correct.
The 2 real name of resources are:
s(0) = MultiLanguage.strings.resources
s(1) = MultiLanguage.Form1.resources

I've tryied to place it on
System.Resources.ResourceManager("MultiLanguage.Resources.strings",
GetType(Form1).Assembly) but still get the error.

What can I do?

Thanks
Gizmo


:

Check that:
1. Your project has a file named Resources.strings.resx with its build
action set to embedded resource
2. Your project namespace is MultiLanguage (see in your project
properties)

If you are still having issues, add this line at the top of your
LoadResources and stick a breakpoint on it:
Dim s() As String =
[Assembly].GetExecutingAssembly().GetManifestResourceNames() //check
in
the
debugger for the real names of your resources

For more on localisation:
http://www.danielmoth.com/Blog/2004/12/satellite-assemblies.html

Cheers
Daniel
--
http://www.danielmoth.com/Blog/

Hi everyboby,
I'm trying to make an appz with multilanguage and I've foud an
example
in
C#
(WorldClock).
I've revritten in VB but I get a MissingManifestError. Could someone
help
me?
Thanks in advance..

Gizmo

Here the code:

Imports System.Globalization

Public Class Form1
Inherits System.Windows.Forms.Form
Friend WithEvents Label1 As System.Windows.Forms.Label
Friend WithEvents MainMenu1 As System.Windows.Forms.MainMenu

Dim rm As System.Resources.ResourceManager
Dim uici As System.Globalization.CultureInfo

#Region " Windows Form Designer generated code "

Public Sub New()
MyBase.New()

'This call is required by the Windows Form Designer.
InitializeComponent()

'Add any initialization after the InitializeComponent() call
rm = New
System.Resources.ResourceManager("MultiLanguage.Resources.strings",
GetType(Form1).Assembly)
uici =
CType(System.Globalization.CultureInfo.CurrentUICulture.Clone,
CultureInfo)

LoadResources()

End Sub

'Form overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As
Boolean)
MyBase.Dispose(disposing)
End Sub

'NOTE: The following procedure is required by the Windows Form
Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
Friend WithEvents MenuItem1 As System.Windows.Forms.MenuItem
Friend WithEvents MenuItem2 As System.Windows.Forms.MenuItem
Friend WithEvents MenuItem3 As System.Windows.Forms.MenuItem
Private Sub InitializeComponent()
Me.MainMenu1 = New System.Windows.Forms.MainMenu
Me.Label1 = New System.Windows.Forms.Label
Me.MenuItem1 = New System.Windows.Forms.MenuItem
Me.MenuItem2 = New System.Windows.Forms.MenuItem
Me.MenuItem3 = New System.Windows.Forms.MenuItem
'
'MainMenu1
'
Me.MainMenu1.MenuItems.Add(Me.MenuItem1)
'
'Label1
'
Me.Label1.Location = New System.Drawing.Point(24, 40)
Me.Label1.Text = "Label1"
'
'MenuItem1
'
Me.MenuItem1.MenuItems.Add(Me.MenuItem2)
Me.MenuItem1.MenuItems.Add(Me.MenuItem3)
Me.MenuItem1.Text = "Lingua"
'
'MenuItem2
'
Me.MenuItem2.Text = "Inglese"
'
'MenuItem3
'
Me.MenuItem3.Text = "Italiano"
'
'Form1
'
Me.Controls.Add(Me.Label1)
Me.Menu = Me.MainMenu1
Me.Text = "Form1"

End Sub

#End Region

Private Sub MenuItem2_Click(ByVal sender As System.Object, ByVal
e
As
System.EventArgs) Handles MenuItem2.Click
'Inglese
uici = New CultureInfo("en")
LoadResources()
End Sub

Private Sub MenuItem3_Click(ByVal sender As System.Object, ByVal
e
As
System.EventArgs) Handles MenuItem3.Click
'Italiano
uici = New CultureInfo("it")
LoadResources()
End Sub

Private Sub LoadResources()
Label1.Text = rm.GetString("Label1", uici)


End Sub
End Class
 
G

Guest

It work!!
But I still not understand why with C# it use
MultiLanguage.Resources.strings..
I don't know how to attach a file here...

Thank

Daniel Moth said:
Please keep all posts (including attachments) to this group.

Change this:
MultiLanguage.Resources.strings
to
MultiLanguage.strings

You could have easily found that yourself, in fact you did. Read your own
post (there is no "Resources" straight after MulitLanguage):
So to answer your question to me in the email: Focus is what I recommend.

Cheers
Daniel
--
http://www.danielmoth.com/Blog/

Gizmo said:
:( I've tryed to change the name but no results.. I've send it the project
to
your mail..

Thanks

Gizmo

Daniel Moth said:
You have the "strings" and "resources" the wrong way round.

You are getting an exception because you are suing the wrong name. In the
constructor of ResourceManager change the name according to the debug
info
and you will get it working.

Give it a go and if you haven't solved it in an hour post back with your
project zipped and I'll have a look at it. You'll get much greater
satisfaction fixing it yourself now that you know the problem is in the
string you are passing to RM.

Cheers
Daniel
--
http://www.danielmoth.com/Blog/

Hi Daniel,
i've checked the 2 points and are correct.
The 2 real name of resources are:
s(0) = MultiLanguage.strings.resources
s(1) = MultiLanguage.Form1.resources

I've tryied to place it on
System.Resources.ResourceManager("MultiLanguage.Resources.strings",
GetType(Form1).Assembly) but still get the error.

What can I do?

Thanks
Gizmo


:

Check that:
1. Your project has a file named Resources.strings.resx with its build
action set to embedded resource
2. Your project namespace is MultiLanguage (see in your project
properties)

If you are still having issues, add this line at the top of your
LoadResources and stick a breakpoint on it:
Dim s() As String =
[Assembly].GetExecutingAssembly().GetManifestResourceNames() //check
in
the
debugger for the real names of your resources

For more on localisation:
http://www.danielmoth.com/Blog/2004/12/satellite-assemblies.html

Cheers
Daniel
--
http://www.danielmoth.com/Blog/

Hi everyboby,
I'm trying to make an appz with multilanguage and I've foud an
example
in
C#
(WorldClock).
I've revritten in VB but I get a MissingManifestError. Could someone
help
me?
Thanks in advance..

Gizmo

Here the code:

Imports System.Globalization

Public Class Form1
Inherits System.Windows.Forms.Form
Friend WithEvents Label1 As System.Windows.Forms.Label
Friend WithEvents MainMenu1 As System.Windows.Forms.MainMenu

Dim rm As System.Resources.ResourceManager
Dim uici As System.Globalization.CultureInfo

#Region " Windows Form Designer generated code "

Public Sub New()
MyBase.New()

'This call is required by the Windows Form Designer.
InitializeComponent()

'Add any initialization after the InitializeComponent() call
rm = New
System.Resources.ResourceManager("MultiLanguage.Resources.strings",
GetType(Form1).Assembly)
uici =
CType(System.Globalization.CultureInfo.CurrentUICulture.Clone,
CultureInfo)

LoadResources()

End Sub

'Form overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As
Boolean)
MyBase.Dispose(disposing)
End Sub

'NOTE: The following procedure is required by the Windows Form
Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
Friend WithEvents MenuItem1 As System.Windows.Forms.MenuItem
Friend WithEvents MenuItem2 As System.Windows.Forms.MenuItem
Friend WithEvents MenuItem3 As System.Windows.Forms.MenuItem
Private Sub InitializeComponent()
Me.MainMenu1 = New System.Windows.Forms.MainMenu
Me.Label1 = New System.Windows.Forms.Label
Me.MenuItem1 = New System.Windows.Forms.MenuItem
Me.MenuItem2 = New System.Windows.Forms.MenuItem
Me.MenuItem3 = New System.Windows.Forms.MenuItem
'
'MainMenu1
'
Me.MainMenu1.MenuItems.Add(Me.MenuItem1)
'
'Label1
'
Me.Label1.Location = New System.Drawing.Point(24, 40)
Me.Label1.Text = "Label1"
'
'MenuItem1
'
Me.MenuItem1.MenuItems.Add(Me.MenuItem2)
Me.MenuItem1.MenuItems.Add(Me.MenuItem3)
Me.MenuItem1.Text = "Lingua"
'
'MenuItem2
'
Me.MenuItem2.Text = "Inglese"
'
'MenuItem3
'
Me.MenuItem3.Text = "Italiano"
'
'Form1
'
Me.Controls.Add(Me.Label1)
Me.Menu = Me.MainMenu1
Me.Text = "Form1"

End Sub

#End Region

Private Sub MenuItem2_Click(ByVal sender As System.Object, ByVal
e
As
System.EventArgs) Handles MenuItem2.Click
'Inglese
uici = New CultureInfo("en")
LoadResources()
End Sub

Private Sub MenuItem3_Click(ByVal sender As System.Object, ByVal
e
As
System.EventArgs) Handles MenuItem3.Click
'Italiano
uici = New CultureInfo("it")
LoadResources()
End Sub

Private Sub LoadResources()
Label1.Text = rm.GetString("Label1", uici)


End Sub
End Class
 
D

Daniel Moth

It work!!
Glad to hear that.
But I still not understand why with C# it use
MultiLanguage.Resources.strings..
Because the VB & C# teams have a different view of the world. This has been
discussed in the past e.g.
http://groups.google.com/group/micr...cbcd?q=resource+vb+c#&rnum=1#a5a6eb32ed66cbcd

Cheers
Daniel
--
http://www.danielmoth.com/Blog/

Gizmo said:
It work!!
But I still not understand why with C# it use
MultiLanguage.Resources.strings..
I don't know how to attach a file here...

Thank

Daniel Moth said:
Please keep all posts (including attachments) to this group.

Change this:
MultiLanguage.Resources.strings
to
MultiLanguage.strings

You could have easily found that yourself, in fact you did. Read your own
post (there is no "Resources" straight after MulitLanguage):
s(0) = MultiLanguage.strings.resources

So to answer your question to me in the email: Focus is what I recommend.

Cheers
Daniel
--
http://www.danielmoth.com/Blog/

Gizmo said:
:( I've tryed to change the name but no results.. I've send it the
project
to
your mail..

Thanks

Gizmo

:

You have the "strings" and "resources" the wrong way round.

You are getting an exception because you are suing the wrong name. In
the
constructor of ResourceManager change the name according to the debug
info
and you will get it working.

Give it a go and if you haven't solved it in an hour post back with
your
project zipped and I'll have a look at it. You'll get much greater
satisfaction fixing it yourself now that you know the problem is in
the
string you are passing to RM.

Cheers
Daniel
--
http://www.danielmoth.com/Blog/

Hi Daniel,
i've checked the 2 points and are correct.
The 2 real name of resources are:
s(0) = MultiLanguage.strings.resources
s(1) = MultiLanguage.Form1.resources

I've tryied to place it on
System.Resources.ResourceManager("MultiLanguage.Resources.strings",
GetType(Form1).Assembly) but still get the error.

What can I do?

Thanks
Gizmo


:

Check that:
1. Your project has a file named Resources.strings.resx with its
build
action set to embedded resource
2. Your project namespace is MultiLanguage (see in your project
properties)

If you are still having issues, add this line at the top of your
LoadResources and stick a breakpoint on it:
Dim s() As String =
[Assembly].GetExecutingAssembly().GetManifestResourceNames()
//check
in
the
debugger for the real names of your resources

For more on localisation:
http://www.danielmoth.com/Blog/2004/12/satellite-assemblies.html

Cheers
Daniel
--
http://www.danielmoth.com/Blog/

Hi everyboby,
I'm trying to make an appz with multilanguage and I've foud an
example
in
C#
(WorldClock).
I've revritten in VB but I get a MissingManifestError. Could
someone
help
me?
Thanks in advance..

Gizmo

Here the code:

Imports System.Globalization

Public Class Form1
Inherits System.Windows.Forms.Form
Friend WithEvents Label1 As System.Windows.Forms.Label
Friend WithEvents MainMenu1 As System.Windows.Forms.MainMenu

Dim rm As System.Resources.ResourceManager
Dim uici As System.Globalization.CultureInfo

#Region " Windows Form Designer generated code "

Public Sub New()
MyBase.New()

'This call is required by the Windows Form Designer.
InitializeComponent()

'Add any initialization after the InitializeComponent()
call
rm = New
System.Resources.ResourceManager("MultiLanguage.Resources.strings",
GetType(Form1).Assembly)
uici =
CType(System.Globalization.CultureInfo.CurrentUICulture.Clone,
CultureInfo)

LoadResources()

End Sub

'Form overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As
Boolean)
MyBase.Dispose(disposing)
End Sub

'NOTE: The following procedure is required by the Windows Form
Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
Friend WithEvents MenuItem1 As System.Windows.Forms.MenuItem
Friend WithEvents MenuItem2 As System.Windows.Forms.MenuItem
Friend WithEvents MenuItem3 As System.Windows.Forms.MenuItem
Private Sub InitializeComponent()
Me.MainMenu1 = New System.Windows.Forms.MainMenu
Me.Label1 = New System.Windows.Forms.Label
Me.MenuItem1 = New System.Windows.Forms.MenuItem
Me.MenuItem2 = New System.Windows.Forms.MenuItem
Me.MenuItem3 = New System.Windows.Forms.MenuItem
'
'MainMenu1
'
Me.MainMenu1.MenuItems.Add(Me.MenuItem1)
'
'Label1
'
Me.Label1.Location = New System.Drawing.Point(24, 40)
Me.Label1.Text = "Label1"
'
'MenuItem1
'
Me.MenuItem1.MenuItems.Add(Me.MenuItem2)
Me.MenuItem1.MenuItems.Add(Me.MenuItem3)
Me.MenuItem1.Text = "Lingua"
'
'MenuItem2
'
Me.MenuItem2.Text = "Inglese"
'
'MenuItem3
'
Me.MenuItem3.Text = "Italiano"
'
'Form1
'
Me.Controls.Add(Me.Label1)
Me.Menu = Me.MainMenu1
Me.Text = "Form1"

End Sub

#End Region

Private Sub MenuItem2_Click(ByVal sender As System.Object,
ByVal
e
As
System.EventArgs) Handles MenuItem2.Click
'Inglese
uici = New CultureInfo("en")
LoadResources()
End Sub

Private Sub MenuItem3_Click(ByVal sender As System.Object,
ByVal
e
As
System.EventArgs) Handles MenuItem3.Click
'Italiano
uici = New CultureInfo("it")
LoadResources()
End Sub

Private Sub LoadResources()
Label1.Text = rm.GetString("Label1", uici)


End Sub
End Class
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top