|
You are correct. Sorry if I wasn't clear.
Ben
|
|
|
|
|
Surely not - you only have to code the class to create it.
To make it clear to anybody else - I am joking.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Thank you all for helping me out.
|
|
|
|
|
I am using a .net console apllication(C#) which makes API calls to a web service. There is a large amount of data transfer.
The exception i am getting is "The operation has timed out".
I generated stub classes from WDL files and using them in client application.
Where can i set the timeout value.
Is it on the client application or on the web server. and what parameters are used to set the time out value.
thanks
|
|
|
|
|
There are 2 types of timeouts that you can specify on the client side when making a call to a web service: send and receive. If you're expecting to send a large amount of data, increase the send timeout; if you're expecting to receive a large amount of data, increase the receive timeout. You can of course specify both or none.
The timeouts are properties of the binding. Here's an example of how to specify them.
string url = "http://localhost:1234/MyService";
EndpointAddress address = new EndpointAddress (url);
WSHttpBinding binding = new WSHttpBinding();
<code>binding.SendTimeout = ...;</code>
<code>binding.ReceiveTimeout = ...;</code>
ChannelFactory<IMyService> cf =
new ChannelFactory<IMyService>(binding, address);
IMyService svcProxy = cf.CreateChannel();
svcProxy.MyMethod();
Hope this helps!
/ravi
|
|
|
|
|
Thanks for the fast reply.
It seems system.servicemodel is supported by only .Net framework 3.0, but i am using 2.0. so are there any equivalent methods in 2.0
|
|
|
|
|
Sorry, I (incorrectly) assumed you were using WCF.
/ravi
|
|
|
|
|
I have a question about windowless controls. I need to make an control (actually a sprite control). If I derive it from control, I can't get the flickering to stop when I am drawing more sprites one on top of the other, and all of them updating fast. So no I need to make this control windowless(without a HWND), but I still want to keep the advantages of design-time.
So, can I make a windowless control but still set the control from the design-time?
Thanks in advance!
|
|
|
|
|
Derive from UserControl and make sure that DoubleBuffered = True .
|
|
|
|
|
Well, I can't derive from usercontrol, because usercontrol is derived from Control, wich in turn is derived from IWin32Window, i.e it has a HWND. This is exactly what I don't want, I want to do the painting with only one Graphics(the forms Graphics). And if I use a control, and 10 instances of it, each drawing one over the other() maybe with transparency, DoubleBuffer can't help me. I need something more "light" than a control, but still be albe the process events. Thanks
|
|
|
|
|
Any object can process events. Controls just map to events by default. Not quite sure what you are trying to do but, you will eventually need a Graphics object in order to draw. You can derive from Bitmap and draw on it using Graphics.FromImage. Eventually, the sprite will have to be drawn to a window using Graphics.DrawImage. The window you will be drawing too, should be double buffered.
Maybe you need to create an Canvas object and a Sprite object. Sprites get painted on the Canvas which is derived from a control. Canvas can be the source for Sprites to grab thier events.
|
|
|
|
|
Well, let me tell you in more detail. I have to write a 2D(maybe latter) 32 game engine. But I will eventually need to write many games wich are very simmilar, that is why i am first of all thinking of me(the developer). That is why I want to make visual controls, so I can make the game from the Designer, to write little code.
My problem is that I am sure that deriving from Control is bad behaviour, because that control is actually a new window. Actually, now i realise that the only thing from the control is the client area and the events + the design-time. I don't want to write code every time I put a sprite on the form, I want to add it from the toolbox
|
|
|
|
|
Your sprites cannot be seperate controls. You'll NEVER get rid of the flickering and you run into performance problems with all the damn PAINT messages flying around to dozens of windows, no matter what you do. Everything has to be drawn on the same surface which can then be drawn to the screen in one shot.
Instead of trying to force Windows Forms to do something it wasn't intended to do, use the right tool for the job. Check into the XAN Framework[^]. It's designed specifically for writing games.
|
|
|
|
|
Well, I now see that you are right, I can't use controls for game development. But I can't use XNA, because I am not writing games for me, there are thousands of users playing this games(actually they are casino games - slots, blackjack etc..) so I can't tell them that they need XP SP2, video card that supports Shader Model etc... My current game engine is written in C++ Builder, but I still don't use controls, and it is hard for me to write a lot of code, and when I open the project, my form is empty! I am now looking at managed directx, but my question is there any way to use something that "looks" like a control at design-time, but at runtime it's not?
|
|
|
|
|
ctoma2005 wrote: I am now looking at managed directx,
If you're using this,
ctoma2005 wrote: but my question is there any way to use something that "looks" like a control at design-time, but at runtime it's not
This becomes a moot point.
|
|
|
|
|
Hmm, I am not really understanding whats a "moot point", but I am guessing that you are telling me to stop asking? I don't know where to ask... My ideea is that I wan't to make my controls in a way that I would develop the game exactly like in flash..at design-time and use only little time coding. Is there any way I can do this?
|
|
|
|
|
ctoma2005 wrote: Hmm, I am not really understanding whats a "moot point",
It means "pointless".
ctoma2005 wrote: Is there any way I can do this?
I already told you. The quickest method is going to be the XNA Framework.
|
|
|
|
|
Well, I already said that XNA framework ask for to many requirements, I can't use it, because I am not writing this for me, but for a lot of clients that use the current games(written in C++ Builder) on any windows version. Plus, XNA doesn't give me any design-time help. I wrote my sprite as a non-visual component, but I don't know how to, for example, change a property and "see" the change on the screen.
|
|
|
|
|
Also, take a look at the Component class. It will give you your design time interface.
|
|
|
|
|
Hi to all,
I want to search a specific string into ListBox. how can i do it?
Pravin
|
|
|
|
|
Listbox class has Items property which gets the items of the listbox. You can iterate over them and search for the string you are interested in.
|
|
|
|
|
ListBox.FindString() and ListBox.FindStringExact()
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
Hello All,
I'd be grateful if someone could give me some pointers or recommend some good links on writing addins for Messenger Live. I'm a bit new to C# so I'm treating this as a mini-project to better my understanding. Essentially what I'd like to do is add a spell check facility to Messenger using Word's Spelling API's.
I've written a small addin for Messenger using some example code and found another good example of calling MS Words Spell checker.
The Messenger example code I'm looking for is how to add a button to the conversation window.
Also are there any security limitation on what I'm trying to do as I noted on MSDN that add-ins run in a security sand-box, using the "Internet Zone" permissions, they have very limited permissions about reading/writing files, modifying the system registry and so on. To make sure an add-in runs in a fully trusted environment, you should install your assembly in the GAC.
Does anyone have any suggestions?
Thanks in advance.
|
|
|
|
|
I'd bet that using the Word APIs to spell check won't be possibly in Messenger's sandbox.
There are plenty of other free, portable spell checkers/dictionaries you could use though.
|
|
|
|
|
Hello,
I have a datagridview that is updating its DataSource every few seconds. I am maintaining the same DataTable and merging any new data that comes in. I am having an issue with the behavior when adding new rows. Say my grid has 100 rows and the user is scrolled down to view row 50. At that time, the grid gets 100 more rows and adds them. I need to keep the user at their scroll position or keep them in view of their selected row. Cheers
|
|
|
|