Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / Managed C++ / October 2004

Tip: Looking for answers? Try searching our database.

using Forms in a DLL

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Fireangel - 28 Jun 2004 13:27 GMT
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

---

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.