Jump to content
Xtreme .Net Talk

divil

*Gurus*
  • Posts

    3026
  • Joined

  • Last visited

Everything posted by divil

  1. Call the control's Invalidate method - that will mark it to be redrawn next time the application is idle.
  2. You can redirect the standard input and output of console applications (such as cmd.exe) when you start the process. Check out the RedirectStandardInput property of the ProcessStartInfo class. Once you have started a process with this property set to true, you can use myProcess.StandardInput.WriteLine("cd blah") etc to control it.
  3. Attributes are great - but I don't know of any articles on them. MSDN probably has some good pages on the concept though.
  4. Presumably those other projects in the solution compile to dlls, so providing you've made a project reference to them, you can just instantiate their classes like you would a class in the same app.
  5. Personally I wouldn't deviate from the recommended way. Especially when VolteFace says you should :P
  6. If you had read the post above mine that I was (obviously) replying to, you would have understood.
  7. If you have to compare them, then checking pixel by pixel is going to have to be how you do it. This doesn't necessarily have to be slow; if you use unsafe code in C# to get at the bitmapdata of both of them it ought to be lightning fast.
  8. You can achieve this by creating a structure and using an explicit field layout on it so the memory address used by the three variables you're interested in is shared: Imports System Imports System.Runtime.InteropServices Namespace Test Public Class Test <StructLayout(LayoutKind.Explicit)> _ Private Structure Shorts2Float <FieldOffset(0)> _ Public s1 As UInt16 <FieldOffset(2)> _ Public s2 As UInt16 <FieldOffset(0)> _ Public f As Single End Structure Public Shared Sub Main() Dim s1 As UInt16 = Convert.ToUInt16(16455) Dim s2 As UInt16 = Convert.ToUInt16(44564) Dim s2f As Shorts2Float = New Shorts2Float s2f.s1 = s1 s2f.s2 = s2 Dim f As Single = s2f.f Debug.WriteLine("{0}", s2f.f.ToString()) End Sub End Class End Namespace Something like that ought to get you started.
  9. I agree with Derek - that's my only positive thought towards the introduction of a game programming forum.
  10. In future, can all GDI questions be posted in the Interop forum, thanks.
  11. Before you use GDI objects on a dc, you have to select them in to it. If you want to use a pen, bitmap, brush or whatever, you select them in to the device context with SelectObject. That api returns a handle to the last object, which you should always restore when you're done using SelectObject again.
  12. You can catch that with the Resize event.
  13. net send is not a DOS command.
  14. Nope.
  15. wyrd: GDI+ is a layer above GDI, not really a wrapper. It allows you to do so much more, it's bound to be slower. GDI+ is an api in itself just like GDI is/was, you can use it from nonmanaged code.
  16. People using Windows 95 can't use .net anyway.
  17. I'm sure the user would just love a ~25MB exe file. :P
  18. The post went off the bottom of the page because nobody answered it, as you well know.
  19. Couldn't you use the GetPixel api instead? That would avoid having to create bitmaps and use bitblt, you could just read the pixel straight from the screen.
  20. Yeah, uninstalling was what I meant.
  21. Try removing all traces of any visual studio .net from your system and reinstalling.
  22. I already gave the answer to this problem, why would he want to disguise the problem by removing the close button altogether?
  23. VB gained >> and << bitwise operators in the latest version, although it still can't work with unsigned types so their usefulness is limited. VB has optional parameters, C# doesn't C# has operator overloading, VB doesn't VB has late binding, C# doesn't C# supports unsafe code (where you can work with pointers), VB doesn't Although late binding is generally a bad idea, it has its uses. There is no CreateObject in C#, which makes working with unknown COM types impossible without heavy use of reflection.
  24. They can be faster, for the same reason as the test I ran was faster. I don't know of anyone who has actually used managed DX9 in a large scale project so I don't know how well it scales. I know some of the guys who were on the managed dx9 team and they speak very highly of it. I know that managed dx9 is not a wrapper for anything, it's a core part of directx. That surely gains it some speed.
  25. This is a bug in windows forms that occurs when you remove a control that contains the focus. To work around it, set the focus to another control outside the control you're removing just before you remove it.
×
×
  • Create New...