Jump to content
Xtreme .Net Talk

Wile

Avatar/Signature
  • Posts

    202
  • Joined

  • Last visited

About Wile

  • Birthday 05/24/1974

Personal Information

  • .NET Preferred Language
    C#

Wile's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Did you set the EnableRaisingEvents property on the process to true? As far as I know, your application wont get the information that the process has stopped without it.
  2. Although I've never used it myself, there is a 'low level mouse hook' in windows. You might want to search on LowLevelMouseProc if you're interested. As I understand it, this is a callback that is called by the OS when the mouse is operated. You can set the hook with SetWindowsHookEx.
  3. We're using System.Reflection.MethodInfo.GetCurrentMethod().Name; I have no idea how this is influenced by the inlining that PlausiblyDamp describes, but we havent had problems with it yet. *searches for wood*
  4. The separators are a different class: ToolStripSeparator instead of ToolStripMenuItem. After creating a separator you can add it to the context menu in the same way as a normal menu item.
  5. I usually use http://www.pinvoke.net/index.aspx. But the platform SDK (PSDK you mentioned?) should cover all defines related to regular use. You'll have to wade through some (probably a lot ;) ) .h files to find the correct define, but most things are in there. (Don't use the windows built-in search, it is reproducibly crap when it comes to searching for text in files. :rolleyes: ) But there is also a directX development kit, driver development kit and probably some other development kits as well. Haven't tried any of them so I don't know what is in them (just documents / tools, or also actual definitions / code files ). I don't know what sort of information you are looking for, but it might be in one of these other development kits.
  6. Wile

    Gameport

    Havent seen a recent sound blaster with a gameport. Besides I think gameports are completely replaced by USB, I dont think there is still a joystick on the market that connects through the gameport (at least I hope not ;) ).
  7. I have no idea, but some ppl did: http://www.codeproject.com/vb/net/vbnettreelistview.asp http://www.codeproject.com/cs/miscctrl/extendedlistviews.asp http://www.codeproject.com/cs/miscctrl/treelistview.asp
  8. I know rational purify plus has something like that. It can generate coverage information (what part of code is called how often, taking how many milliseconds of time to finish) so it is possible. Havent worked with it recently but if my memory is correct it does some kind of profiling on your binary before running it. That would mean it injects its own profiling code. Dont know how this works with signed binaries though, havent used it that extensively on managed code. Mostly use it for finding memory leaks in old fashioned C++, which it does very well :eek: ;). On the tracing part I use this http://www.codeproject.com/csharp/tracetool.asp, which is free (rational tools will never be considered cheap ;) ). Does everything I need for tracing and works for managed and unmanaged code.
  9. Havent tried this myself, but you can use the 'where' clause to contstraint a type. I think this would make the declaration something like: [CS] public interface IPartnerCollection<T, V> where T : MyInterface1 where V : MyInterface2[/CS] In this case whatever object is used as T, it must inherit MyInterface1, V must inherit MyInterface2. see here for more information: http://msdn2.microsoft.com/en-us/library/6b0scde8.aspx
  10. I think there is one question that has a big performance on the server side (and client side) of the game: How much of the game will be handled server side? If I take the settlers example: After placing a structure you can balance the load between client & server a bit. Putting everything server side: -Server keeps track of the animation (so it triggers the 'walk to tree', 'chop tree', 'walk back to building' animations) the server can also update the wood resource update at the correct moment. This has the advantage that it is quite hard for players to cheat as the server determines the amount of resource a player has. Or you can let the client side take care of most of the work. -Server only knows about the structure, but lets the clients do all the calculation. This means the client side will trigger the correct animation, update the resource count, etc. Disadvantage: easy to cheat. Advantage: a lot less communication between client & server, load on server is much less. You can play around with this balancing (server side vs client side) a lot to optimze performance, for cpu (client & server side) and bandwidth requirements. To make sure you dont overload the system to much, I would go with the solution from Plausiblydamp. Have a 'heartbeat' timer at say 25 msec (that gives you 40 updates per sec, more than enough for AI, triggering animation, etc.). It will check each building/person/item to see if something has to be done. Most things should be able to very quickly check if they have something to do. It isnt hard to make an overload protection for this mechanism either: if one timer pulse is till running while the next is triggered, prevent the 2nd from checking every object. If this protection is needed often you'd better look into changing the updatefrequency and the work performed during an update.
  11. Perhaps this is the article you refer to? (If it isnt, it is still a good article ;) ) http://www.yoda.arachsys.com/csharp/threads/ Third page got a bit of code that resembles yours, with some minor changes (basically making index a member variable of the object instead of a local variable.)).
  12. Your expectations of the behavior of the override method are correct. If you override a virtual method in a subclass (CharacterClass in this case), the overriding method is automatically called when the virtual method (A) is called. That it isnt happening in your code means that something else is wrong. My first guess is, that the object isnt a CharacterClass, but a BaseClass. Check where you create the object and see if you create a CharacterClass or a BaseClass. My first guess would be that you actually create a BaseClass object instead of a CharacterClass. In that case the compiler/runtime dont know about the CharacterClass and the override, and will call the implementation in the baseclass. Virtual-override only works when you create the subclass. You can cast it to the baseclass without a problem, the override still exists. One trick would be to make it abstract instead of virtual. That forces the class to become abstact, then the compiler wont allow you to create it anymore. You must create the CharacterClass subclass. If you find a compile problem with the class as abstract, you probably found the actual problem why it doesnt work at this moment. I'll use a bit of C++ analogy to explain a bit what I think happens with virtual-override. Somewhere the compiler creates a table of all the virtual methods of an object. In that table there is an adress of the 'current' implementation for a virtual method. When a subclass overrides a virtual method, it overwrites the adress of that 'current' implementation. That means that if the object is casted to something else in the object hierarchy, the override is still 'registered' as the implementation to use. However, if you only create the baseclass, the subclass can never overwrite the information -> you keep the original virtual method without implementation. (offcourse this is not exactly what happens, but it is pretty close to what happens in C++ ;) )
  13. If you are directly using the GUI from the separate threads, yes that can cause a lookup. GUI related stuff should be done on the thread that created the GUI components. That sounds harder than it is, you can use <control>.InvokeRequired to see if you are on the correct thread, and <control>.Invoke to send the command to the GUI thread if you are not. Search this forum for InvokeRequired, you'll find several examples like this: http://www.xtremedotnettalk.com/showthread.php?t=86818&highlight=InvokeRequired
  14. I havent looked at the vb code, but if you need to use API functions instead of .net methods to avoid a problem, a good starting point is http://www.pinvoke.net/index.aspx This is a wiki containing most (if not all) of the windows API with definition (and often examples) to pinvoke them -> call them from .net. For FindFirstFile it finds: http://www.pinvoke.net/default.aspx/kernel32/FindFirstFile.html Hope this helps.
  15. What I ment was that System.Globalization.CultureInfo.InvariantCulture is fixed. However if you dont specify a culture when converting, .NET will probably take the local settings of the machine, which are not fixed ;). The double.Parse() method has several overloads. Two of these let you specify an IFormatProvider. This IFormatProvider will tell the parse method what the decimal character is. If you use the invariantculture as IFormatProvider, you always have the same conversion, independent on the system settings. So [CS]double.Parse(myDouble)[/CS] would be depending on the local settings off the system but [CS]double.Parse(myDouble, System.Globalization.CultureInfo.InvariantCulture)[/CS] would always work the same way, no matter what the system settings are.
×
×
  • Create New...