|
I Second what Luc says.
However, I would like to suggest looking at more errors. I believe that there must be more than one errors in case the files are not compiled.
Also, are these two files in the same project? (I know it is too basic a question. But better to confirm).
|
|
|
|
|
Isn't there a class named MyProgram?
If I understood what's happenning, it's something like this:
The Designer will always re-generate code (you change something in the form, it's code is regenerated enterelly).
But, to "avoid" problems, the full namespace is used. Here is the problem, it uses the full namespace, but does not add the global::
So, as you are inside MyProgram namespace, when it puts the "MyProgram." it finds a class with such name, and use it.
I really think that's the problem. To solve this, change the name of your class. I am not 100% sure that you have such class, but that's the only way I can reproduce the error.
|
|
|
|
|
Paulo Zemek wrote: Isn't there a class named MyProgram?
As far as I can tell, there is.
It's a class dealing with resources for multi-language-support. I don't remember if it was automatically generated with the name of "MyProgram.MyProgram", but I think that was necessary for some automated feature to find the files
- MyProgram.resx,
- MyProgram.en-US.resx and
- MyProgram.de-DE.resx.
Can I rename the class without breaking the multi-language-support?
How do I find the class?Ciao,
luker
|
|
|
|
|
In the line where the error with the MyProgram appears.
Right click in the word MyProgram and use the Go to definition function of the menu.
But I don't know how that was made... when I add multi-language support the name of the resource file is not really important, but if you have hand-written the name of the resource in strings you will need to find and replace them.
Another choice is to rename the namespace.
|
|
|
|
|
Paulo Zemek wrote: use the Go to definition function.
Another choice is to rename the namespace.
I tried both ways and they both fail because the resource class is generated automatically every time I change a resource.
I can change the name of the class and the change gets undone as soon as I change a resource.
I can change the namespace and the resource class changes its name accordingly as soon as I change a resource.
It seems like I have to move all of my self-created classes out of the application's standard namespace to avoid the conflict.
Any concerns about that?
Or does anyone have another solution?Ciao,
luker
|
|
|
|
|
How do you check if, for example, an xls file really contains a spreadsheet? If an image called test.jpg is renamed to test.xls, how could I, in C#, figure out that text.xls is actually an image?
|
|
|
|
|
Try opening it in the target application.
I wouldn't bother trying to guess.
|
|
|
|
|
Try and load it using the appropriate library built to parse that kind of file.
Other than that, you have to examine each and every byte yourself, parsing the file yourself, and validating all the data yourself. For every kind of file format, that's an enormous amount of work.
|
|
|
|
|
If your application is meant to handle almost any kind of file, then you have a tough job. Every file essentially is a series of bytes. Unless you scan that and then try to match it with actual pattern, I can't think of a concrete solution.
You can try opening the file with the associated program. That too will not guarantee detection since many file will open (although distorted and with weird characters) in the associated program.
I found this[^] through google. You can check if it helps.
|
|
|
|
|
i search a lot for program in c# that can record from web cam
can any one help!
Sorry and thanks
every time i search more harder in this web i found what i want so if any one wants to know the solution it is DirectShow.NET
for the Administrator you told me not to put the Q and A in the same Message so if you wants to remove it, it is your job.
thank you codeprojectmodified on Tuesday, March 2, 2010 9:02 AM
|
|
|
|
|
Your post doesn't make much sense at all, so, point-by-piont:
sanforjackass wrote: i search a lot for program in c# that can record from web cam
C# and the .NET Framework has no managed classes to do this. You must use an outside library.
sanforjackass wrote: every time i search more harder in this web i found what i want so if any one wants to know the solution it is DirectShow.NET
Yeah. And?
sanforjackass wrote: for the Administrator you told me not to put the Q and A in the same Message so if you wants to remove it, it is your job.
What are you talking about?
|
|
|
|
|
Is there any way to do optional variable declaration in c# 3.5.
I have two alternatives.
(a) Function Overloading
(b) declaring the function arguments in Params Object[] variable
Can i do it exactly the way we can do in vb.net ?
|
|
|
|
|
C# 4.0 introduces optional parameters, you can't do it in 3.5.
abcurl wrote: Can i do it exactly the way we can do in vb.net ?
Why would you ever compare anything to VB? I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Mark Nischalke wrote: Why would you ever compare anything to VB?
OK, well you can do optional parameters in C++. Would that have been a better comparison? Kevin
|
|
|
|
|
Yes, VB and C++ are much closer. I know the language. I've read a book. - _Madmatt
|
|
|
|
|
VB can compared to many things, normally prefixed with "A big steaming pile of....." Dalek Dave: There are many words that some find offensive, Homosexuality, Alcoholism, Religion, Visual Basic, Manchester United, Butter.
|
|
|
|
|
Here is how to do it in 4.0:
Named and Optional Arguments[^]
Told you: shameless Dalek Dave: There are many words that some find offensive, Homosexuality, Alcoholism, Religion, Visual Basic, Manchester United, Butter.
|
|
|
|
|
Mark Nischalke wrote: C# 4.0 introduces optional parameters, you can't do it in 3.5.
Back to the future......Me, I'm dishonest. And a dishonest man you can always trust to be dishonest. Honestly. It's the honest ones you want to watch out for...
|
|
|
|
|
|
I'm polishing up the Delorean now I know the language. I've read a book. - _Madmatt
|
|
|
|
|
I never understood why it gathers that much dust while going back in time; most objects do when aging.
|
|
|
|
|
hello everyone!!
I have a problem.
i build a service and i build install to.
i install my service and is work beautiful.
but...if he as a error he stop the service and write to my even log.
i dont want to stop my service if he as a error.what i do?how to fix that?
|
|
|
|
|
Services stop when an unhandled exception is thrown, so you need to make sure you handle them. You could maybe do this quite high up - do you have a loop on a thread created in OnStart()?
However, that just assumes you can just carry on if something bad happens. You really need to consider the execution path which may result from an exception being thrown. If you get a network error, you might want to try again a short while later. If you run out of memory or disc space, you probably do want the service to stop...Regards,
Rob Philpott.
|
|
|
|
|
hi,
There two ways for multilanguage that i've studied so far.
1. Resoure files
2. XML File
Which is the best and why?
Syed Shahid Hussain
|
|
|
|
|
Message Closed
modified 23-Nov-14 6:43am.
|
|
|
|
|
Thanks
but how to set the label text from resource. Do v need to set the captions of all labels at the loading of the form or there is any other technique.Syed Shahid Hussain
|
|
|
|