Jump to content
Xtreme .Net Talk

PlausiblyDamp

Administrators
  • Posts

    7016
  • Joined

  • Last visited

Everything posted by PlausiblyDamp

  1. If the objects contained within the hashtable support IDisposable then you could just loop through the items disposing each in turn.
  2. Try adding a using System.Runtime.InteropServices; to the top of the file.
  3. Does this happen with all forms or just a particular form? Does it work if you open it non-modal? Could you post the relevant code to see if that sheds any light on the subject?
  4. What other conditions do you check to see if the data needs refreshing? Are there any other controls on the page that could cause a post back?
  5. Try the following... _ Public Function Test(ByVal i As Integer) Test(i, 0) End Function _ Public Function Test(ByVal i As Integer, ByVal j As Integer) End Function although in the test page it will display both test1 and test2 create a sample app and reference the web service - you will just get 2 versions of the Test method. If you are referring to the page you get when you run a web service then do not worry - that is just there as a convenience for the developer. In practice you would never expect a user to access it
  6. You could just use a for ... each loop. For Each c As Control In Controls c.Text = "Blah!" Next
  7. Out of curiosity - why? Wouldn't it be easier to handle the event in the button click itself rather than the page load? It may help if you give a bit more detail about what you are trying to do as there be a better way.
  8. Any chance you could post the relevant code line(s) and give a bit more detail about your networking configuration / ip used?
  9. Public Sub val(ByVal X as device ) x = nothing End Sub is effectively sendin a copy of the reference (or pointer) to the object in memory - that means any changes done through this reference will affect the object; however any changes done to the reference itself will not be reflected in the calling routine. Public Sub ref(ByRef x as device) x = nothing End Sub In this case you are passing the reference itself any changes done to the reference will be reflected in the calling routine.
  10. Is office installed on the other PC? If so is it the same version?
  11. If you select the mdb file in the Solution Explorer you should be able to set its Build Action to Content from the properties window. It should now be copied to the output directory. Easiest way of storing application settings is to add an app.config file to your project - this works similar to a web.config in terms of how you store / access values.
  12. As those games aren't written using managed code they will not be using managed DirectX. If you are using unmanaged code then you would access directX through the non-managed interface. If you are using managed code then you would use the managed interface.
  13. Any chance you could try it again and record the error message? It helps a lot if you can give people a bit more information on these things. Also is IIS properly installed on your PC? Can you browse to http://localhost ?
  14. Although the code is VB the ideas in http://www.xtremedotnettalk.com/showthread.php?t=83092 should be what you are after.
  15. Have you tried putting a call to Application.DoEvents inside the loop?
  16. If you close the applications main form then it should exit the program.
  17. You are missing a using directive. add using System.Runtime.InteropServices; to the top of the file
  18. http://www.go-mono.com is worth a look.
  19. I can't see them cutting their own revenue stream by allowing the existing IDE to work with the new framework. They are giving away the SDK etc for free as it is. Visual Studio 2005 has had a lot of work put into it - they will want some return on their investment...
  20. IIRC the code would create two instances of the texture rather than reuse the same object - you are going to be better off with your custom texture manager if you are using the same texture several times. The other problem with loading the same texture multiple times is that it will need to be transfered to the video card's ram multiple times (which is usually much smaller than system ram) From what I have read I get the feeling a sprite isn't much more than a convenient wrapper around a textured quad anyway - performance wise there should be very little if any difference. They do however have a fairly easy interface to use. I think The Pentium Guy has done a tutorial on them (either here or on his web site).
  21. Is there a reason why you need to convert them to bitmaps to use with a HashTable rather than the format you are using with the array based implementation? If you are getting errors - what errors are you getting? Rather than a static array you could wrap it in a singleton and provide public methods to generate / retreive the array. Also what is preventing you using a static array? You should still be able to set it to null / assign new values to it regardless of it being static.
  22. Any chance you could post the relevant code?
  23. Any chance you could post the relevant code, the config file, details on where the config file / exe are located?
  24. Following is a simple Console application which will enumerate over the open windows and display the handle and caption for each. If you need to do something more complex then you will probably be able to call another API using the provided hWnd parameter in the WindowEnumerator method. The sample calls three API calls to get a result - GetWindowTextLength and GetWindowText to get the caption of the window and EnumWindows to actually get the list of windows. using System; using System.Text; using System.Runtime.InteropServices; namespace EnumerateWindowSample { /// /// Summary description for Class1. /// class Class1 { [DllImport("user32.dll", SetLastError=true, CharSet=CharSet.Auto)] static extern int GetWindowTextLength(IntPtr hWnd); [DllImport("user32.dll", SetLastError=true, CharSet=CharSet.Auto)] static extern int GetWindowText(IntPtr hWnd, [Out] StringBuilder lpString, int nMaxCount); [DllImport("user32.dll")] static extern bool EnumWindows(EnumWindowsProc lpEnumFunc, IntPtr lParam); delegate int EnumWindowsProc(IntPtr hWnd, IntPtr lParam); static int WindowEnumerator(IntPtr hWnd, IntPtr lParam) { int length = GetWindowTextLength(hWnd); StringBuilder sb = new StringBuilder(length + 1); GetWindowText(hWnd, sb, sb.Capacity); Console.WriteLine("Handle {0}, \t Caption {1}", hWnd, sb.ToString()); return -1; } /// /// The main entry point for the application. /// [sTAThread] static void Main(string[] args) { EnumWindowsProc wp = new EnumWindowsProc(WindowEnumerator); EnumWindows(wp, IntPtr.Zero); Console.ReadLine(); } } }
  25. If you step through the code does everything seem to work fine? If you check the return value when you call ExecuteNonQuery() what value is returned from the call?
×
×
  • Create New...