Custom MessageBox Problem

M

Mystique

I have created a custom MessageBox in a seperate DLL that has two resource
files containing string in two languages. When i call my show method i get
(that's when i'm getting the string from the string table / resource) i get
the following:

============================================================================
====================
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.Resources.MissingManifestResourceException: Could not find any
resources appropriate for the specified culture (or the neutral culture) in
the given assembly. Make sure
"Resources.StringTables.MNStringsEN.resources" was correctly embedded or
linked into assembly "MNClient".
baseName: Resources.StringTables.MNStringsEN locationInfo: <null> resource
file name: Resources.StringTables.MNStringsEN.resources assembly: MNClient,
Version=1.0.1580.21443, Culture=neutral, PublicKeyToken=null
at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo
culture, Boolean createIfNotExists, Boolean tryParents)
at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo
culture, Boolean createIfNotExists, Boolean tryParents)
at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo
culture, Boolean createIfNotExists, Boolean tryParents)
at System.Resources.ResourceManager.GetString(String name, CultureInfo
culture)
at System.Resources.ResourceManager.GetString(String name)
at MNClient.Forms.MNMessageBox.Show(MNAppManager appMgr, IWin32Window
owner, String text, String caption, MessageBoxButtons buttons,
MessageBoxIcon icon) in c:\work\katastar\me-cad\module
2\implementation\application\me-cad
module2\mnclient\source\forms\mnmessagebox.cs:line 132
at MNClient.Forms.MNMessageBox.Show(MNAppManager appMgr, String text,
String caption, MessageBoxButtons buttons, MessageBoxIcon icon) in
c:\work\katastar\me-cad\module 2\implementation\application\me-cad
module2\mnclient\source\forms\mnmessagebox.cs:line 260
at PLClient.PLDialogLogin.tbLogon_Click(Object sender, EventArgs e) in
c:\work\katastar\me-cad\module 2\implementation\application\me-cad
module2\plclient\source\pldialoglogin.cs:line 208
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons
button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg,
IntPtr wparam, IntPtr lparam)
============================================================================
====================
 
M

Morten Wennevik

Hi Mystique,

My guess is that the ResourceManager is looking for the files on the
drive, and the current directory is different than when you compiled the
messagebox.dll. Try to embed the resource files.

Happy coding!
Morten Wennevik [C# MVP]
 
M

Mystique

:-(
Actually they are in the same folder, and they are as "Embedded Resource"!

Hi Mystique,

My guess is that the ResourceManager is looking for the files on the
drive, and the current directory is different than when you compiled the
messagebox.dll. Try to embed the resource files.

Happy coding!
Morten Wennevik [C# MVP]
 
M

Morten Wennevik

Can you compile the control successfully?
I had some similar error once when I didn't name the resource correctly.

Happy coding!
Morten Wennevik [C# MVP]
 
M

Mystique

thanks, but i managed to solve it by changing the default namespace name.
:)

Can you compile the control successfully?
I had some similar error once when I didn't name the resource correctly.

Happy coding!
Morten Wennevik [C# MVP]
 

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