Re: Looking for speed performance to draw line.

From: Mike D Sutton (EDais_at_mvps.org)
Date: 11/02/04

  • Next message: Christoph Basedau: "Re: Write onto Active-X Control"
    Date: Tue, 2 Nov 2004 20:52:16 -0000
    
    

    > The sound is perfect for me. but i don't know how to do link list in VB.
    > Even i don't need if i use type array.

    A linked list is simply one (for a single-direction list) or two (for a bi-directional list) additional piece(s) of information for
    each item in an array, that being the next and/or previous indexes. When you need to insert an item in the array you use the first
    available array entry and simply adjust the 'next' pointer from the item before where you wish to insert the new element to point at
    your new array index, and it's next pointer to the previous item's original next pointer.
    I.e:

    Original list (Order: 2, 0, 1):

    0) Next 1, Prev 2
    1) Next -1, Prev 0
    2) Next 0, Prev -1

    (Assuming -1 means a null pointer i.e. the list ends)
    Add new item:

    3) Next ?, Prev ?

    Break link between 2 and 0 and insert new item (Order: 2, 3, 0, 1)

    0) Next 1, Prev 3
    1) Next -1, Prev 0
    2) Next 3, Prev -1
    3) Next 0, Prev 2

    > Yes, it should be Add, delete and modify same commands like in AutoCAD i
    > have develop. for EG. Trim, offset, fillet, array, Mirror etc.

    It's unlikely you need to implement a linked list for this, however for a full CAD application it may be best to wrap the individual
    shapes up into shape classes that implemented the required commands

    > if possible please add tutorial in your site "implement a linked list in VB"

    Hopefully the above helped with that one.

    > and for speed performance "using GDI with ..... (C++ and VB)",

    The C++ DLL tutorial details using GDI in C++, as for performance it's negligible since you're calling the same code in either
    language..

    > "collection and array C++ vs VB"

    If you need to work with objects then Collections are the way to go, otherwise use arrays.
    Hope this helps,

        Mike

     - Microsoft Visual Basic MVP -
    E-Mail: EDais@mvps.org
    WWW: http://EDais.mvps.org/


  • Next message: Christoph Basedau: "Re: Write onto Active-X Control"

    Relevant Pages

    • Re: passing a string to a C++ function
      ... method to get a pointer into an array, since I assume that he was first to ... Loz. ... Prev by Date: ...
      (microsoft.public.vc.language)
    • Re: pointer value
      ... It is a pointer to an ... array of 10 ints. ... the broken "Reply" link at the bottom of the article. ... Prev by Date: ...
      (comp.lang.c)
    • Re: Array of class and a pointer to it
      ... arrays, and pointing to the object. ... m_pMyClass is not a pointer, but an array. ... Prev by Date: ...
      (microsoft.public.vc.language)
    • Re: dynamically allocating a 2d array
      ... its first element. ... int (*array)[X] which is a pointer to an array of X integers. ... Prev by Date: ...
      (comp.lang.c)
    • Re: Multiple Condition Sumif Formula
      ... Andy. ... > revenue column. ... > & I've tried to enter the formula as an array by doing ... Prev by Date: ...
      (microsoft.public.excel.worksheet.functions)