|
i want to know where do i have to make changes in order to add complile error hanle page?
i have created a page and i want to put it in project. what do i do for it to be working?
thank you
|
|
|
|
|
You want a page to handle compiler errors? Your site won't run if you have a compile error!
In the event you actually mean something else - add the file to your project by right-clicking on the project & selecting "Add Existing Item...", browse for file & add it. Then add a Global.asax file to the project (assuming you don't already have one). Inside the AppilcationError event of the Global.asax file add code to handle your error & redirect to your error page as required.
I think I'm going to call my next project "Chuck Norris". It's a sure way to guarantee it's unbreakable.
• • •
But fortunately we have the nanny-state politicians who can step in to protect us poor stupid consumers, most of whom would not know a JVM from a frozen chicken. Bruce Pierson
|
|
|
|
|
Hi All
Initially i had two applications which access a dll for its method for sending and recieving data.So i got a error saying illegal thread cross operation .So in order to avoid it , i created a delegate and then add a if condition
if (this.InvokeRequired)
{
MyDelegateMethod theDelegateMethod = new MyDelegateMethod (this.DisplayMessage);
this.Invoke(theDelegateMethod, new object[] { message });
}
else
{
ReceiveMessage(message);
}
by doing this i could eliminate the error.Now when i changed one application which was in windows to a webserivce , i am not getting this invoke method ..so what will i do ..
Can any one help me in this regard to overcome this situation
And second one which i heard to overcome above situation was using
System.Windows.Forms.Control.CheckForIllegalCrossThreadCalls = false;
In window appn i am getting CheckForIllegalCrossThreadCalls properties but in webservice i am not getting it..
pls help me if any one has idea in it
Regards
DilipRam
|
|
|
|
|
Hi,
the cross-thread problem is inherent in how controls work; they are not thread-
safe, so the right approach is for each control to have only one thread ever
working on it, normally that's the main thread aka GUI thread.
there was no checking before .NET 2.0 and an app would work, partially work,
suddenly hang, whatever if you did it wrong.
.NET 2.0 checks and throws InvalidOperationException (as you know), unless
you set CheckForIllegalCrossThreadCalls false, in which case you return to
the pre 2.0 situation. I cant recommend that.
The normal solution is similar to what you have, with one difference:
the delegate and the else part of the if normally call the same method.
In your code it is DisplayMessage and ReceiveMessage !?
BTW: I am not sure what "this" is refering to in your web service, does
it has controls while not having a GUI ??
|
|
|
|
|
Thanks for the reply
regarding the DisplayMessage and ReceiveMessage first one is event handler delegate for recieving messages and second one is local method for processing the receiving message..just for readability..then regarding this i was just pasting the code in my windows applications..So what is ur suggestion..What i understand from your reply is that 2003 will not throw the illegal operation error and so i dont want to check it..Am i right..If i am wrong then what is best solution.
Regards
DilipRam
|
|
|
|
|
|
thanks for the reply
i have done it in 2.0 but i want it in 1.1
Anyway thanks for replying me
Regards
DilipRam
|
|
|
|
|
Hi,
if you get cross-thread exceptions, something is wrong in your app.
Going back to 1.x or setting CheckCrossThread=false are two ways to
hide the symptoms, they dont cure the disease.
The cross-thread exceptions 2.0 and later are given are extra symptoms
to make you aware there is a disease which you should fix.
the right way is with Control.InvokeRequired and Control.Invoke;
yuou normally have two choices:
- make the delegate and the else part point to the same method;
- make the delegate point to the method it is in (this is kind of a
recursive call, but the second time around InvokeRequired will be false
hence the else part will execute).
|
|
|
|
|
Hi thanks for the reply,but the problem i am facing is that i was initially working with windows application ,now i want same method to implemented in webservice .but in webservice i am not getting invoke properties..Hope u understand my problem.Since i am not getting the invoke properties, i am not able to check that condition..
Any way to play with it.
Regards
DilipRam
|
|
|
|
|
Hello experts,
I'm applying some finishing touches to one of my applications.
The exe's icon was selected via the project's properties, on the "Application" section, where it says "Icon:".
Now, if I would create a shortcut to some file, and attempt to change its icon, pointing the icon selection dialog to my exe, the dialog would display the program's icon.
Same goes for any other icon sucking program...
I'm guessing that the program's icon is embedded in a specific section of the exe, which later gets scanned by the icon selection dialog.
How can I embed icons to the exe so they would also be in the same section?
Thanks in advance,
Shy.
|
|
|
|
|
Take a look at the last entry in this[^] discussion.
|
|
|
|
|
Thanks, but it did not work for me...
However, I've found my own solution.
After compiling the exe file, you open it in VS, either by selecting it via File > Open > File, or by clicking the small "Show all files" icon on the top of the solution explorer, navigating (still in the solution explorer) to the exe file, and double clicking it.
In the new opened tab it is possible to import the icon into the already compiled exe.
Of course it has to be done EVERY TIME the exe is recompiled, which is quite annoying...
So I'm thinking of learning how to use Post-Build Events...
Maybe I could make VS import the icon automatically every time...
Well... I hope this post will help others achieve the same goal.
I intend to write a small article about this, and maybe combine it with another subject. Hope I'll have the time...
Regards,
Shy.
|
|
|
|
|
Ok I've found out how to do it
- File | New
- Select Native Resource Template
- Import icons etc you want
- File | Save As (make sure 32-bit resource (*.res) is selected in the File Type combo)
- Save the file somewhere
- Open up the properties pages of your Project, change the radio button by the Application icon to Resource File
- Browse & select the resource file.
- Voila!
This should probably be put into an article at some point since there's no where sensible where this is explained (that I came across)... If I've got time over the weekend I'll do it, unless you want to?
|
|
|
|
|
|
shyagam wrote: Go ahead and write the article...
Done (needed something to make me fall asleep ).
|
|
|
|
|
Hehe... Cool!
You even got the screen shots and all...
Voted 5 for the article of course!
Well... I guess that now, after solving the problem, I can start coding again and compensate for all of the day time I've lost.
Another sleepless night...
Regards,
Shy.
|
|
|
|
|
shyagam wrote: Voted 5 for the article of course!
Thank you
shyagam wrote: You even got the screen shots and all...
Well I had to pad out the article...
|
|
|
|
|
can sum1 kindly lemme know how shouldi make a snooker game in C#??
all kinda tips and tricks..
do share plz..
i need them for my project
waiting anxiously
umair
|
|
|
|
|
First step - learn C#
Second step - learn DirectX ( probably )
Third step - learn some physics
Fourth step - write the code
Your question is far too broad, all you can hope to get are broad answers. You'd do better to tell us what you do know, what you're looking to learn about, etc. Even then, really, the best way to get help is to write some code, and ask questions about specific issues.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
And cut down the textspeak, too
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
Oh, that goes without saying.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
I am curious to see if people that textspeak alot on these forums are at a computer or posting messages through a pda...
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
I suspect at a PC, but just used to communicating that way.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
It could be just a force of habit kind of thing.
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
I think it's two things:
1 - force of habit, as you say
2 - young people have always found new ways to express themselves, so that us old folks can't understand them.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|