|
Hi All,
Is it possible to make the dynamically enum,means it should be created based on the values picked from DB?
Thanks,
Lalit
|
|
|
|
|
Enums are compile time constants and can't be modified/created at run time.
|
|
|
|
|
Appartently they can be created at run time, but they'd be fairly useless as far as I can tell.
|
|
|
|
|
Try using T4
Look here[^] to get you started.
|
|
|
|
|
Not in a way that it would be any useful.
I think that you should look into how you could use a Dictionary instead.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
You can always compile an unit using CodeDOM, but I doubt it will be any useful, as it will not have any hard-coded references to it.
I also suggest using dictionaries to do the job.
|
|
|
|
|
Hi friends,
I have a small project, of which, I do not want to create any setup. Now, I have copied the project .exe file (standalone application) from Debug-Bin-project.exe and am trying to execute it on another machine which has .NET framework 2.0 and 3.5 installed. But surprisingly, I get an error message something like this: The application failed to initialize properly (000000000000..//error code..) Click Ok to terminate the application. . Can anyone explain me the reason for this. Does this mean, that what I did ain't the appropriate way of creating or running a standalone executable application? If yes, then please explain me a better way.
Your help will be truly appreciated,
Rajdeep.NET
|
|
|
|
|
Rajdeep.NET wrote: Now, I have copied the project .exe file (standalone application) from Debug-Bin-project.exe and am trying to execute it on another machine
Make sure you copy all dependent files as well, like configuration files and other assembly(not the .NET framework assemblies) references.
Rajdeep.NET wrote: The application failed to initialize properly (000000000000..//error code..) Click Ok to terminate the application.
Look in the event viewer for a detailed error message.
|
|
|
|
|
N a v a n e e t h wrote: Make sure you copy all dependent files as well, like configuration files and other assembly(not the .NET framework assemblies) references.
Hi Navaneeth,
Thanks for your help yaar, but I want to extract only the .exe file. And moreover, my clients wont be having Visual Studio.NET installed on their system. So, copying the configuration files and assemblies wont help. I've seen many applications which are standalone with just an .exe and no setup is required. Just downloading'em and running the .exe does the work. Ain't it possible in this case?
Help needed,
Rajdeep.NET
|
|
|
|
|
Did you reference any dll's? If so, those dll's have to reside on the cpu where the app will run. This also counts for any setting/configuration file.
If you use databases, does the connectionstring also count for that machine?
there could be a million other reasons why it failed.
Some suggestions:
- Add some error handling, so the user will get a clean error message on failure.
- Add some logging so you can at least find the error when it occurs.
- Read up on software development.
hope that helps.
|
|
|
|
|
Rajdeep.NET wrote: And moreover, my clients wont be having Visual Studio.NET installed on their system
VS .NET is just an editor and your client don't need to install that at all. Your client needs to install only .NET framework redistributable package. If your application is using only the framework classes, copying EXE may work.
|
|
|
|
|
If you have developed a .NET application (which by all the other questions you have posted in he last week or two seems very likely) then the target machine must have the .NET framework installed. I could be wrong, but I believe Vista has this automatically, but definately XP doesn't.
Prior to .NET (native code) EXE files do not always require more than just the EXE file.
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|
|
It's quite possible to accomplish that you need only the .exe file to run the application, but then you have to be careful not to use anything that is stored outside of it.
The configuration file is not for Visual Studio, it's for the program itself. Some controls (for example the OpenFileDialog) saves informtion in the configuration file. If you use a control that does, you either need the configuration file, or you need to change the settings of the control so that it doesn't use the file.
If you have referenced any libraries that is not in the framework, you need those .dll files along with the .exe file.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Rajdeep.NET wrote: Debug
That might be your problem. Try a release build.
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Individuality is fine, as long as we do it together - F. Burns
Help humanity, join the CodeProject grid computing team here
|
|
|
|
|
That should be fine, you must be missing something.
|
|
|
|
|
Hi
I am working with office interops to read excel data. I need some way to release the excel.exe images opened by the program whenever a crash occurs. I've enclosed the application call in the Main() method with try {run application} catch{get rid of excel}. This works but it's a bit ugly. Is there any other way I can do this?
Thanks
Karl
|
|
|
|
|
aastudent wrote: This works but it's a bit ugly
Why? It looks Ok to me.
|
|
|
|
|
I code the C# program
I would like to know how to improve the time that my code generates the thumbnails
(I use getThumbnail module)
Image size is about 3 - 4 K. Now, It spends 1 sec. per image.
The commercial app. like ACDSee spends less than 1 sec.
Any methods or modules for C# that speed up the thumbnail generation please advice.
Or that's just C# GDI's module limitation.
Thank you.
|
|
|
|
|
Hi,
I can´t understand this:
help!
I´m developing application, and it´s using iText Library for generate PDF. The text input must be Rich formated. The pdf document generated, must be exactly equal to text. I´m parsed the text, for generated font name, color,size and then, the objects needed for iText ( it´s not support RTF to PDF conversions )
I´m using RichEdit Control, but the font size is not correct in comparission with the generated pdf. ( also are images objects ).
Then, I did a SIMPLE test with the DrawString method (gdi), ( same text, same font name and font size ), but they are not equal WIDTH. ( Richtext and drawtext ).
The height and the size of each character are equal. The only diference is the char spacing
Conclusion: using a DrawString method generated the correct pdf (correct size).
Why occurs this ?
I need resolve this problem with the fuc... Rich Edit Control.
Thanks!
PS: sorry for my poor english
modified on Wednesday, May 13, 2009 1:29 AM
|
|
|
|
|
I think that this is all because of the differences in the ways that GDI and GDI+ handle text.
Take a look at GDI v GDI+[^].
There are lots of articles/snippets out there, just Google for gdi v gdi+.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Hi,
How can we determine a device type using IP address. I want to know whether the device is a desktop or laptop or IP phone .... Input for this is IP address. I got the Manufacturer of the device by fetching MAC address using IP.
Thanks in advance...
Lekshmi
|
|
|
|
|
And may I know, what has this got to do with .NET?!
|
|
|
|
|
Actually I think you can't. I know that there are some possibilities, but not determining it just from the IP address, if you ask me.
Please correct me if I am wrong, would be interesting to know.
Cheers
You have the thought that modern physics just relay on assumptions, that somehow depends on a smile of a cat, which isn’t there.( Albert Einstein)
|
|
|
|
|
There is a ICMP Node Information Query request that can be issued, but I am not sure what information it returns - I've never used it. Google is (hopefully) your friend here!
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|
|
Dear All,
That's strange that when I use TryEnter in Timer event which triggers every 1 sec, the TryEnter() always returns true. Why there is such an error?
public partial class Form1 : Form
{
private object BlockingObj = new object();
private void timer1_Tick(object sender, EventArgs e)
{
bool ret = System.Threading.Monitor.TryEnter(BlockingObj, 1);
if (ret){
try
{
DialogResult result = MessageBox.Show("test", "", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
}
finally
{
System.Threading.Monitor.Exit(BlockingObj);
}
}
}
}
|
|
|
|