|
Hi,
How to create separtor line in menu. (like in Visual C++)
|
|
|
|
|
neatSeparatorMenuItem.Text = "-";
Andy Gaskell, MCSD MCDBA
|
|
|
|
|
Does anyone else think this is an evil way to create separators, or is it just me?
I was thinking more along the lines of a MenuItemCollection.AddSeparator() method, or perhaps a class MenuSeparator derived from MenuItem.
Dunno if I got those names right, because I'm away from my dev computer -- stuck on this miserable vacation
Anyways, I'd be interested in other people's thoughts on this issue.
-Domenic Denicola- [CPUA 0x1337]
MadHamster Creations
"I was born human. But this was an accident of fate - a condition merely of time and place. I believe it's something we have the power to change..."
|
|
|
|
|
|
Eric Gunnerson (msft) wrote:
I think it's evil.
Nice one, Eric.
I'd be interested what your recommendation was/would have been for this.
Cheers,
Simon
"Sign up for a chance to be among the first to experience the wrath of the gods.", Microsoft's home page (24/06/2002)
|
|
|
|
|
I am afraid that looks horrible
|
|
|
|
|
it doesn't mean that session will be terminated when you close the window.
james liu
|
|
|
|
|
|
I want to do some job on Session_End in global.asmx, but when I close the IE, it cannot be occured.
I'm amumu, and you?
|
|
|
|
|
|
Hi ,
I have to develop a SOAP service that will work over sockets.
The clients could be calling from any language on any OS, so remoting is no good.
ASP.NET only allows a service over IIS http so that does help.
Is there are way of doing this in C#? Is there a way in to the SOAP classess behind ASP.NET?
Thanks,
Keith
|
|
|
|
|
Situation :-
-------------
I have remoted an object, say A.
All fine, no problems.
In A I have a method that returns an object B.
The problem:-
-------------
When I call the method that returns B, I get an exception:-
Unhandled Exception: System.InvalidCastException: Return argument has an invalid type.at System.Runtime.Remoting.Proxies.RealProxy.ValidateReturnArg(Object arg, Type paramType)
Why is this?
B is marked as [Serializable]
Nish
p.s. I can call other methods that return strings and ints without problems
Author of the romantic comedy
Summer Love and Some more Cricket [New Win]
Review by Shog9
Click here for review[NW]
|
|
|
|
|
Is that your class/object that you are trying to return? If so, you may need to implement the ISerializable interface and write your own serialize method. On the other hand, it might be helpful to see the code that calls the remote method...
P.S. What is your MSN IM address, Nish???
David Stone
dstone@newcenturytitle.com
Procrastination is like masturbation; it's all good until you realize you just screwed yourself.
-Writing on a bench at college
|
|
|
|
|
David Stone wrote:
Is that your class/object that you are trying to return?
David, the issue was that, instead of putting my interfaces in a DLL and both client and server referencing the DLL, I put them in a header file and included them at client and server [MC++ code]
When I put them in a DLL, it worked
And we do not have to mark it ISerializable, just derive it from MarshalByRefObject.
Regards
Nish
Author of the romantic comedy
Summer Love and Some more Cricket [New Win]
Review by Shog9
Click here for review[NW]
|
|
|
|
|
Right. I know that we don't have to mark it as ISerializable....but that can be helpful if you want to do your own serialization. Why were you using a header file? Isn't this the C# forum?
Just as a side note...what exactly does MarshallByRefObject do?
David Stone
dstone@newcenturytitle.com
Procrastination is like masturbation; it's all good until you realize you just screwed yourself.
-Writing on a bench at college
|
|
|
|
|
Hi There,
I'm very new to all this web services stuff and would like to learn. I tried downloading the C# web services examples and followed the direction on building and running it. I ran into this problem: When trying to access the *.asmx file from the browser, Internet Explorer prompted me to download the file. After downloading it, I asked IE to open it and all I got was the content of the *.asmx file. Something like the following:
<%@ WebService Language="c#" Codebehind="WebService1.cs" Class="MyService.WebService1" %>"
Instead of the web page. I managed to compiled the solution just fine, the problem arise when I tried to view the page. Any comment or feedback would be more than appreciated.
Thanks in advance.
|
|
|
|
|
It sounds like the webserver doesn't have ASP.NET installed.
James
"Java is free - and worth every penny." - Christian Graus
|
|
|
|
|
Use command:
aspnet_iisreg -i
to install .net framework to your iis server.
I'm amumu, and you?
|
|
|
|
|
Thank you all for your input. It turned out that I did have ASP.NET install or so I thought. I did windows update before and already downloaded and installed the .NET Framework. I then install IIS which does not pick up the .NET Framework. Thanks to you guys, I just reinstall ASP.NET and IIS finally picked it up and it's working great now.
Thanks
|
|
|
|
|
I have a custom treeview class with a couple of extra properties and methods. When I try to serialize an object of that type, I get a compiler error saying that TreeView has not been marked as serializable. Any suggestions as to how I can serialize this object?
Any help would be greatly appreciated.
|
|
|
|
|
If you implement ISerializable you can control how the serialization happens; so that instead of serializing a TreeView; you serialize the parts you need to recreate it (ie the nodes, and your custom property).
If the nodes aren't serializable, you'll have to do something special with them too.
James
"Java is free - and worth every penny." - Christian Graus
|
|
|
|
|
I gave up on serializing the treeview, instead I just made a class with the same properties and meathod as before. The class has one extra property: a TreeNode. It is essentially just a root node for everything that would have been in the treeview.
I implemented ISerializable like you said, and it serializes and deserializes perfectly except when the TreeNode has any other nodes in it (doh!). Do you know how I can get around this?
Thanks for the help,
Steve
|
|
|
|
|
One more thing I thought of. I could recurse through the nodes. I would have to first serialize all the 'sub'nodes then clear and serialize the node itself. My problem then is: How do I deserialize them?
|
|
|
|
|
All you should have to do is Serialize the root node; it should then serialize everything referenced in that node; including its child nodes.
When you deserialize only worry about the first node; the rest should come with it.
James
"Java is free - and worth every penny." - Christian Graus
|
|
|
|
|
Try running this (and look at the y and z definitions):
using System.IO;
using System.Runtime;
using System.Runtime.Serialization;
using System.Runtime.Serialization.Formatters;
using System.Runtime.Serialization.Formatters.Binary;
.
.
.
TreeNode x,y,z;
x = new TreeNode("Root");
y = x.Nodes.Add("A"); //it only runs if you comment out these lines
z = y.Nodes.Add("1"); //it only runs if you comment out these lines
IFormatter formatter = new BinaryFormatter();
Stream mystream = new FileStream("MyFile.bin", FileMode.Create, FileAccess.Write, FileShare.None);
formatter.Serialize(mystream, x);
mystream.Close();
TreeNode root;
mystream = new FileStream("MyFile.bin", FileMode.Open, FileAccess.Read, FileShare.Read);
root = (TreeNode)formatter.Deserialize(mystream);
MessageBox.Show(root.Text);
Thanks for the help
|
|
|
|