I have a simple managed DLL that contains a basic cMap class. The root namespace is Map. Also in the DLL is a form for viewing it (frmViewMap), along with a toolbar, menu's and the like.
I've created a second project that will use this dll. I'm trying to inherit off of cMap (Basically adding stuff to it). I also created a new class for viewing, which inherits from frmViewMap. When I try to edit the form (to add additional buttons), I get the following error:
"An exception occured while trying to create an instance of Map.frmViewMap. The exception was "Could not find any resources appropriate for the specified culture in the given assemply. Make sure "frmViewMap.resources" was correctly enbedded or linked into assembly "Map"."
If I try to run my second project, it crashes (Unhandled exception) in InitializeComponent in frmViewMap (in the DLL), where it tries to create the image list for the toolbar:
this->ilMainToolb->ImageStream = (__try_cast<System::Windows::Forms::ImageListStreamer * >(resources->GetObject(S"ilMainToolb.ImageStream")));
If I use ildasm.exe on the DLL, and open up MANIFEST, there is a section that says: .mresource public Map.frmViewMap.resources{}. This tells me that it is being included in the DLL. There are no other classes or enums or anything being declared in the same file as frmViewMap or the class that is inheriting.
Where am I going wrong??? I've tried googling it, but I can't find my problem. I've tried several of the solutions, but so far, none of them have worked.
Thanks for any help or poiters..
GE
mphanke - 29 Jun 2004 12:58 GMT
Hi,
for me the problem was with the settings in Project->Properties->Managed
Resources->General->Resource File Name
The original value was
$(IntDir)/$(RootNamespace).$(SafeInputName).resources
After I changed it to
$(IntDir)/$(RootNamespace).$(InputName).resources
I had no further trouble with that.
The problem with $(SafeInputName) was it changed names like
"AppStrings.en" to "AppStringsen". This messed things up.
Hope that helps,
Martin
> I have a simple managed DLL that contains a basic cMap class. The root namespace is Map. Also in the DLL is a form for viewing it (frmViewMap), along with a toolbar, menu's and the like.
>
[quoted text clipped - 11 lines]
>
> GE
DotNetJunkies User - 29 Oct 2004 21:34 GMT
If you think to go back and look at this, or for those of you who stumbled accros this before finding the real answer to this mysterious problem, try seeing if this article resolves your issue.
The short answer, don't put ANY time in front of your Form class in its own file. Full details in the referenced article.
http://support.microsoft.com/default.aspx?scid=kb;en-us;Q318603
Richard Grenfell
---