|
Handle the HttpApplication.Error event in your Global.asax file, or it's related code-behind file. Since auto-event-writeup is enabled by default, you can just declare your handler as
private void Application_Error(object sender, EventArgs e)
{
HttpServerUtility server = HttpContext.Current.Server
Exception e = server.GetLastError();
} For more information, see the documentation for the event I mentioned, and the HttpServerUtility.GetLastError method.
You could also create your own IHttpModule for handling, errors, too, if you require library portability without moving the whole web application.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
There are some buttons in yahoo and hotmail that have fletcher at the left or right of them and when you click on them drop down menu appear and you choose an option. I need them in my windows applicaation in C#.Does anybody know them? I don't have time to develop them myself.
Mazy
No sig. available now.
|
|
|
|
|
You might get an idè by studding the source code for
http://www.codeproject.com/cs/miscctrl/color_picker.asp?target=color%7Cpicker
Thomas
|
|
|
|
|
Hi,
I was just wondering...
how do you make a stand-alone program in Visual C#.net 2003 that can be used by people who do not own visual studio, or any programming language for that matter.
Currently it says that they're missing MSCOREE.dll, and I suspect they're missing about 40 other dlls as well.
Any ideas?
Thanks
|
|
|
|
|
Hi,
The user that executes the program, gotta have the dotNet 1.1 Framework.. =)
..?
// Up The Irons, SirErugor
|
|
|
|
|
It's called the dot net framework. You kind of have to install it on the client computer.
|
|
|
|
|
I already said tha'
// - Up The Irons, SirErugor
|
|
|
|
|
Lord Tor wrote:
how do you make a stand-alone program in Visual C#.net 2003 that can be used by people who do not own visual studio, or any programming language for that matter
[Key points in bold]
There needs to be a distinction in your mind between the framework, the language, the compiler, and the development environment. * The language is the syntax, grammar, and conventions that define how the code is written and interpereted. The compiler turns the code given to it into an executable file or library (called an assembly in the .NET world). The development environment is the application you use to help you create programming projects.
A framework (loosely defined) is a core library that you use to build your applications. ** The .NET framework happens to be an integral part of the C# language - it doesn't function without it. Because of this, the .NET framework must be installed for your applications to run. The .NET framework is a free redistributable, and should not be confused with VS.NET, which is MS's development environment for .NET, and which costs a fortune.
Sorry for being a bit long-winded, but I just wanted to make sure things are clear for you.
* You may already know some of this, but just in case...
** OK, I can just see myself being corrected by the "purists". FYI, I have read Marc Clifton's "What is a Framework?".
|
|
|
|
|
Thank you all for your help. So telling my users to download the .net framework 1.1 is the only thing I need to do? It's not like C++.net, requiring you to statically link your program?
Cheers
Mike
|
|
|
|
|
I have a ASP.Net Web Application project and I have multiples web forms. How do I activate or load a new web form into my current browser window. The method
Form frm = new Form();
frm.ShowDialog();
doesn't work here because this is not a window application. Here we don't have this method available.
I appreciate any help.
The rookie
|
|
|
|
|
As this is an ASP.NET related question perhaps you would like to ask it int the correct forum.
|
|
|
|
|
There are two methods for doing this:
Server.Transfer("yourpagename.aspx");
or
Response.Redirect("yourpagename.aspx");
Hope this helps!
|
|
|
|
|
What is that application that generates *.chm file automatically based on a dll?
Don't forget, that's Persian Gulf not Arabian gulf!
|
|
|
|
|
Have you looked at NDoc?
I, for one, do not think the problem was that the band was down. I think that the problem may have been that there was a Stonehenge monument on the stage that was in danger of being crushed by a dwarf.
-David St. Hubbins
|
|
|
|
|
struct tagSTGMEDIUM
{
int tymed;
[switch_type(int), switch_is((int) tymed)]
union
{
[case(TYMED_GDI)] HBITMAP hBitmap;
[case(TYMED_MFPICT)] HMETAFILEPICT hMetaFilePict;
[case(TYMED_ENHMF)] HENHMETAFILE hEnhMetaFile;
[case(TYMED_HGLOBAL)] HGLOBAL hGlobal;
[case(TYMED_FILE)] LPWSTR lpszFileName;
[case(TYMED_ISTREAM)] IStream *pstm;
[case(TYMED_ISTORAGE)] IStorage *pstg;
[default] ;
};
[unique] IUnknown *pUnkForRelease;
}
The above code is the clas STGMEDIUM
what I'd like to know is how to translate this to C#.
I've figured out the enumeration dictates what type of object the pointer "union" represents, and more or less how it works. But how would I make this case statement in C# that sets the type of an object, in a way in which C would understand?
Is this actualy nescessary? Or can I declare an object variable, and produce a case statement in the structure based on the enumeration? Is this portable to C? Or would the structs be incompatible?
Cheers
Cata
|
|
|
|
|
Actually, a better representation would be:
[StructLayout(LayoutKind.Sequential)]
public struct STDMEDIUM
{
public int tymed;
public IntPtr handle;
public IntPtr pUnkForRelease;
} The handle will work for all cases, since each member is just a pointer, including lpszFileName (since a string pointer is a pointer to the first character in the array). BTW, this is how Microsoft has created their STGMEDIUM struct for internal use as well. As I mentioned before, you'd be wise to learn IL and use ildasm.exe to examine the classes and structs in the .NET BCL, or get yourself a good decompiler like .NET Reflector[^] and examine what you need in System.Windows.Forms . As I mentioned before, the .NET version of IDataObject eventually gets transformed into the COM version of IDataObject and all the .NET-related drag-n-drop stuff is just a wrapper around the native functions and structs, which are all P/Invoked and defined in the System.Windows.Forms.dll assembly (as internal, nested members). This could save you a lot of time in creating what you need (you'll still need to create it, but at least you can get pointers about how to do so from the defined members in that aforementioned assembly).
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Thanks heath, most helpful.
I'll make the enumeration in C# and use that to interpret / designate the integer.
What is IL?
I will definitely look into it.
Cheers
Cata
|
|
|
|
|
IL is Intermediate Language, it's the code that compilers targeting the CLR produce - this is what makes the source language unimportant, because they compile down to IL, or to be more specific, MSIL or Microsoft IL, which is just some extensions to the Common IL specification.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
I've looked at the Reflector program.
Very interesting.
However, I have found all the draganddrop related classes, except the DoDragDrop.
Am I missing something? It's not in there anywere.
Cata
|
|
|
|
|
Found it.
Just got lost looking for a method in Form, when it's in Control.
|
|
|
|
|
Wrong one - you must P/Invoke the native DoDragDrop . It is also in there.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
I found the one that uses the STGMEDIUM structure you pointed out to me.
Where would the native COM DoDragDrop method be?
Cata
|
|
|
|
|
System.Windows.Forms.SafeNativeMethods.DoDragDrop . You really should try to P/Invoke these yourself, though, and then compare them to what Microsoft did. It's a much better way to learn about marshaling and Types.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
I've always found that, if i have a minimal understanding of something, it is helped more by looking at what others do than blundering around in the dark.
If I know roughly what I am doing, then I am happy to try and find my own way.
I shall look it up as you said, and study it.
Marshaling and Types I already understand, even if it's only rudimetry. What I need to do is study the classes to see what I can do with them.
Thanks again.
Cata
|
|
|
|
|
I've gone through the magic-eye and slipstick and microsoft tutorials on extending office applications, but I am none the wiser, and hoping someone here can point me in the right direction.
How do I add a menu-option to (say) the Tools menu in Outlook?
I know:
* Its a COM Add-in thing
* I'm using an IDT2Extensibility
* I have to do it in the OnConnection event that is fired
I have found examples and plenty of information about adding buttons, but I really want to add a menu option - either within the Tools menu or via a new top level menu.
|
|
|
|