Jump to content
Xtreme .Net Talk

divil

*Gurus*
  • Posts

    3026
  • Joined

  • Last visited

Everything posted by divil

  1. If you're creating a graphics object like that, you should be disposing it too.
  2. In .NET, you add children directly to a node, not to the main treeview. You only add top-level nodes to the main treeview. After that, you use the Nodes collection of each node you add. You are correct about using the Insert method if you need to control the position of a node in the list of children, but I don't think that's what you're after.
  3. We get it, but that doesn't mean it's possible - it's not the way Windows works. The only way around would be to draw your own titlebar, and that's never a good solution.
  4. No, you can't increase the stack size. At least, not for something like this - recursion just isn't appropriate. You could investigate other means of maintaining context, using an array or collection-based class. Is there some reason you're using your own type for image data?
  5. Those forums are not nearly as feature-rich as we need.
  6. You are recursing too many times and therefore running out of space on the stack. A recursive function is not suitable to solve a problem like this because of the potential number of pixels involved. You could rewrite using a queue, or use the FloodFill API though.
  7. If you're using the ListView, each item has a Tag property that you can assign anything you like.
  8. Wrong - when they're compiled, it doesn't matter what language .net assemblies are written in, they work with all other .net assemblies.
  9. Visual Studio copes fine with a control in the same project, on my machine. The problem is likely caused by the fact that his form is called ToolManager and his root namespace is the same. Therefore the generated code won't be valid.
  10. There's no need to invoke the garbage collector like that. In my last post I said you need to dispose of objects when you're done with them. In that example you're still not doing this. Bitmap _bitmapNew; _bitmapNew = (Bitmap)Image.FromFile( FileName, false ); _bitmapNew.Dispose(); _bitmapNew = null; Don't worry too much if you see your memory usage increasing - if it becomes a problem, or after a short delay, the garbage collector will collect.
  11. There is no Recordset in ADO.NET :)
  12. If you set the LabelEdit property to true, they'll be able to edit the text in the first column. The ListView control doesn't support editing of subitems.
  13. Unfortunately the ProgressBar class is sealed so you can't override CreateParams and implement this style.
  14. It's worth pointing out that if you have Option Strict On (which you should) you'll have to replace this line Dim frmMain As Form1 = Me.MdiParent with this: Dim frmMain As Form1 = DirectCast(Me.MdiParent, Form1)
  15. You're casting the wrong thing. You want to cast sender, not sender.Parent.
  16. OnErr0r asked me to point out that the Resize Event might occur before Load, so this code could be altered: Private Sub frmTriangle_Resize(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Resize If Not Triangle Is Nothing then If ClientSize.Height > 10 Then Triangle.Create(ClientSize.Width, ClientSize.Height) End if End Sub
  17. You're probably running out of memory and having to swap to disk. Are you disposing of each image and any intermediate bitmaps and graphics objects before loading the next?
  18. No, you'll have to write your own. Also, please don't keep putting my name in your thread titles :)
  19. divil

    callback

    Personally I'd use C#, but that's because I don't like C++. You could write it in both - writing a standard C dll and using platform invoke to interop with it, or using managed C++ to create a .NET class with it. .NET delegates can interop with unmanaged callbacks just fine. I think there's a sample in the .net sdk of using delegates with the win32 function EnumWindows.
  20. It's also worth pointing out that asp.net costs the same as php - nothing. It's a part of the .net framework and if you use the Web Matrix IDE to develop sites with it, you don't even need a computer with IIS to test them on. The IDE has its own webserver written in .net.
  21. divil

    callback

    Sure. Here's a rather useless expansion of the example you gave earlier in this thread. Since the send function calls the callback function this code will result in a stack overflow exception, but you can see how to define the delegate and pass it to the other function. private bool AcceptedId(byte id) { return (id >= 10); } private const int MAX = 100; private delegate void MyDelegateType(byte id); protected virtual void ExOfCallback(byte id) { while ( id++ < MAX ) if (AcceptedId(id)) break; send(id, new MyDelegateType(ExOfCallback)); } private void send(byte id, MyDelegateType myCallback) { // Example of calling the callback function myCallback(id); }
  22. dh = Value.GetService(GetType(IDesignerHost))
  23. Dim emp As Employee = myHourlyEmployee Do you have some problem with that?
  24. divil

    callback

    Delegates are multicast, typesafe function pointers. Once you've defined their signature they can call any method, virtual or not. There's no problem with virtual methods calling themselves in C#.
  25. It looks like you've forgotten to call the base setter at the beginning of your set method: MyBase.Site = Value
×
×
  • Create New...