473,765 Members | 2,035 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Multiple Type Definition Causes Resource Failure

Hello,

I was recently asked to look at someones code to see if i could determine
why a particular form was failing to load and instead generating an error
about a lack of available resources for that locale. The form inherited from
a base form and was defined with an inline namespace rather than defaulting
to the project option dialog namespace. Prior to the class/form definition,
an enum was defined within the namespace scope as below ( i haven't included
the actual definitions)

Namespace Company.Solutio ns.ProductName. UI.WinForms

Public Enum MyEnum
.......
End Enum

Public Class frmCredentials
Inherits ApplicationBase Form
....
End Class

End Namespace


So i fired up Ildasm and had a look at the manifest and found that this
particular class had a resource entry like

..mresource public frmCredentials. resources
{
}

whereas all other classes/forms had a full namespace definitions as in

..mresource public Company.Solutio ns.Product.UI.W inForms.frmXYZ. resources
{
}

So i tried taking out the Enum definition and placing it in a separate .vb
file. This worked. The manifest now had a full namespace entry for the
resources file as below :

..mresource public
Company.Solutio ns.Product.UI.W inForms.frmCred entials.resourc es
{
}

And the form now loads and runs without error.

My question is what difference does this make? Why did this work? Whilst it
is not my preference to include multiple type defintions in the same file, I
wasn't aware that this would cause any problems with respect to compilation
and execution? Although the issue has been resolved, I dont know why what i
did worked?

Does anyone have any ideas? Note if i put the Enum back into the file. It
fails as above.
Thanks
Floppy J.

Nov 21 '05 #1
4 1222
I read somewhere that you must always declare the form class before any
other non-designable declerations. otherwise the Designer does not read
the form properly.

This might relate to your case also:
Try to declare the enum after the form decleration, and see what happens
to the namespace entry.

Atara

*** Sent via Developersdex http://www.developersdex.com ***
Nov 21 '05 #2
Yes this works. There was no problem in the designer however. The problem
was/is in the assembly manifest. So its more of a compilier issue. I dont
suppose you have the link to the info you were talking about? Ive tried
Googling the problem but given the keywords im using i get nothing but
noise.

FJ

"Atara" <At***@DD.com > wrote in message
news:ev******** ******@tk2msftn gp13.phx.gbl...
I read somewhere that you must always declare the form class before any
other non-designable declerations. otherwise the Designer does not read
the form properly.

This might relate to your case also:
Try to declare the enum after the form decleration, and see what happens
to the namespace entry.

Atara

*** Sent via Developersdex http://www.developersdex.com ***

Nov 21 '05 #3

<url:http://groups-beta.google.com/group/...dotnet.framewo
rk.windowsforms/browse_thread/thread/97b90bda835ce6a 9/d97ceb96927bfcd 0?l
nk=st&q=dotnet+ designer+%22two +forms%22&rnum= 1&hl=en#d97ceb9 6927bfcd0>

"...The final thing that I know of that could cause this is that the
designer
will not open if the first class is not the designable class. So, if you
put
an enum or other class at the top of the file, the designer will try to
parse that class instead of the form, and it will fail."


*** Sent via Developersdex http://www.developersdex.com ***
Nov 21 '05 #4
O.k thanks Atara,

Ive had a look at that link but it is for a different problem. My question
is about a problem that doesn;t affect the designer but the manifest.
Mine is about a compliation/runtime issue not a designer issue. Thanks
anyway.

fj

"Atara" <At***@DD.com > wrote in message
news:eo******** ******@TK2MSFTN GP12.phx.gbl...

<url:http://groups-beta.google.com/group/...dotnet.framewo
rk.windowsforms/browse_thread/thread/97b90bda835ce6a 9/d97ceb96927bfcd 0?l
nk=st&q=dotnet+ designer+%22two +forms%22&rnum= 1&hl=en#d97ceb9 6927bfcd0>

"...The final thing that I know of that could cause this is that the
designer
will not open if the first class is not the designable class. So, if you
put
an enum or other class at the top of the file, the designer will try to
parse that class instead of the form, and it will fail."


*** Sent via Developersdex http://www.developersdex.com ***

Nov 21 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
4338
by: Graham Banks | last post by:
Does using multiple inheritance introduce any more performance overhead than single inheritance?
6
2479
by: Boyd Reilly | last post by:
I have a form that has the user pick the type of question he will answer. The input field will be a text, numeric or date type. So, after the question is answered, I need to change the input statement. This resembles what I am doing: <form name="frm1"> Step 1 - Choose a File: <select name="selA" OnChange="makeinputbox;" width="200" style="width:200"> <option value="">Date of Birth</option> <option value="MASTER">Age</option>
9
2793
by: lbj137 | last post by:
I have two files: A.c and B.c. In both files I define a global variable, int xxxx; When I compile with a green hills compiler (and also i think with a GNU compiler) I get no errors or warnings. Only when I initialize xxxx to two different values in A.c and B.c respectively do I get a 'multiple definitions' error. I was under the impression that I would get such an error even without initializing xxxx twice, simply because i am (ostensibly)...
2
5662
by: pawel.pabich | last post by:
Hajo, I know only one way of forcing element to have one or more childes: <xs:element name="saleOrSupplyMethod"> <BR/> <xs:complexType> <xs:choice> <xs:sequence> <xs:element name="generalSale" type="emptyTagType" /> <xs:element name="prescription" type="emptyTagType"/>
12
2062
by: bj7lewis | last post by:
I am working on a project I want to add a few files as resource to access(copy them to FS and use) at runtime. So far in VS.NET IDE, I Add Files to the project and set its Build Action to Embedded Resource... Now where should look next... Any help...
11
22579
by: lars.uffmann | last post by:
Easily described problem: Using g++ version 3.3.5 under suse 9.3, bla.h: ----------- #ifndef myTEST #define myTEST ZFSInt test; #endif
3
3059
by: Antonio Rivas | last post by:
Hello all. I've got a problem of multiple definition in a program that at first glance looks correct (I won't type the whole code, just the relevant one and as examples since seems is a linkage problem): main.cpp ======== using namespace std; ....
58
8122
by: bonneylake | last post by:
Hey Everyone, Well recently i been inserting multiple fields for a section in my form called "serial". Well now i am trying to insert multiple fields for the not only the serial section but also the parts section an i seem to be having trouble. When i try to insert into the parts section i get the error Invalid character value for cast specification. But not sure what i am doing wrong. Here is what i am using to insert. All the sections...
482
27962
by: bonneylake | last post by:
Hey Everyone, Well i am not sure if this is more of a coldfusion problem or a javscript problem. So if i asked my question in the wrong section let me know an all move it to the correct place. what i am trying to display previously entered multiple fields. I am able to get my serial fields to display correctly, but i can not display my parts fields correctly. Currently this is what it does serial information 1 parts 1
0
9568
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10007
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9957
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9835
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6649
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5276
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5423
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3532
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2806
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.