DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Page 4 of 4 FirstFirst ... 234
Results 46 to 59 of 59

Thread: callback function

  1. #46
    Michael Culley Guest

    Re: callback function


    To everyone who downloaded this example before,

    I have updated it and made it far far simpler. It contains only three lines
    of assembly code now. The Class_Initialise is much simpler and has been seperated
    out into functions (such as VarPtr function and function to get address from
    VTable).

    It even contains comments

    Michael Culley

    Address is VBDotCom.Com, click on free code, it is the last item in the list.


    "Karl E. Peterson" <karl@mvps.org> wrote:
    >Hi Mike --
    >
    >I don't dispute it isn't interesting, but it's clear that the disadvantages

    far
    >outweigh any advantages it may or may not offer. Just my opinion, of course.
    >
    >Later... Karl
    >--
    >http://www.mvps.org/vb
    >
    >
    >"Mike Culley" <m_culley@one.net.au> wrote in message news:392db408$1@news.devx.com...
    >>
    >> Karl,
    >>
    >> >I still say it's easier to just upgrade and be done with it! :-)

    >>
    >> This code has some advantage in VB5/6. You don't have to go to the trouble
    >> of sorting out where the callback should go from a list of object pointers
    >> + is faster for this reason. Also, the timer is a single class so is more
    >> encapsulated.
    >>
    >> Michael Culley
    >>
    >> "Karl E. Peterson" <karl@mvps.org> wrote:
    >> >Hi Jonathan / Jason / Mike --
    >> >
    >> >> I for one would not assume this code will always work reliably given

    what
    >> I
    >> >> know. Maybe if I get some time, I'll try to go through it some time.
    >> >
    >> >I still say it's easier to just upgrade and be done with it! :-)
    >> >
    >> >Later... Karl
    >> >--
    >> >http://www.mvps.org/vb
    >> >
    >> >
    >> >

    >>

    >
    >



  2. #47
    Michael Culley Guest

    Re: callback function


    To everyone who downloaded this example before,

    I have updated it and made it far far simpler. It contains only three lines
    of assembly code now. The Class_Initialise is much simpler and has been seperated
    out into functions (such as VarPtr function and function to get address from
    VTable).

    It even contains comments

    Michael Culley

    Address is VBDotCom.Com, click on free code, it is the last item in the list.


    "Karl E. Peterson" <karl@mvps.org> wrote:
    >Hi Mike --
    >
    >I don't dispute it isn't interesting, but it's clear that the disadvantages

    far
    >outweigh any advantages it may or may not offer. Just my opinion, of course.
    >
    >Later... Karl
    >--
    >http://www.mvps.org/vb
    >
    >
    >"Mike Culley" <m_culley@one.net.au> wrote in message news:392db408$1@news.devx.com...
    >>
    >> Karl,
    >>
    >> >I still say it's easier to just upgrade and be done with it! :-)

    >>
    >> This code has some advantage in VB5/6. You don't have to go to the trouble
    >> of sorting out where the callback should go from a list of object pointers
    >> + is faster for this reason. Also, the timer is a single class so is more
    >> encapsulated.
    >>
    >> Michael Culley
    >>
    >> "Karl E. Peterson" <karl@mvps.org> wrote:
    >> >Hi Jonathan / Jason / Mike --
    >> >
    >> >> I for one would not assume this code will always work reliably given

    what
    >> I
    >> >> know. Maybe if I get some time, I'll try to go through it some time.
    >> >
    >> >I still say it's easier to just upgrade and be done with it! :-)
    >> >
    >> >Later... Karl
    >> >--
    >> >http://www.mvps.org/vb
    >> >
    >> >
    >> >

    >>

    >
    >



  3. #48
    Michael \(michka\) Kaplan Guest

    Re: callback function

    Karl did say:

    >I don't dispute it isn't interesting, but it's clear that the disadvantages
    > far outweigh any advantages it may or may not offer. Just my
    > opinion, of course.


    I am still forced to agree here.

    VB4 is such an uncompelling platform for other reasons that I just can't say
    I would be eager to use it anyway...

    Just my opinion, feel free to disagree. :-)

    --
    MichKa
    "Cause it's a bittersweet symphony, thats life..." -- The Verve

    random junk of dubious value, at the multilingual,
    no scripts required, http://www.trigeminal.com/

    "Michael Culley" <m_culley@one.net.au> wrote in message
    news:3937adfd$1@news.devx.com...
    >
    > To everyone who downloaded this example before,
    >
    > I have updated it and made it far far simpler. It contains only three

    lines
    > of assembly code now. The Class_Initialise is much simpler and has been

    seperated
    > out into functions (such as VarPtr function and function to get address

    from
    > VTable).
    >
    > It even contains comments
    >
    > Michael Culley
    >
    > Address is VBDotCom.Com, click on free code, it is the last item in the

    list.
    >
    >
    > "Karl E. Peterson" <karl@mvps.org> wrote:
    > >Hi Mike --
    > >
    > >I don't dispute it isn't interesting, but it's clear that the

    disadvantages
    > far
    > >outweigh any advantages it may or may not offer. Just my opinion, of

    course.
    > >
    > >Later... Karl
    > >--
    > >http://www.mvps.org/vb
    > >
    > >
    > >"Mike Culley" <m_culley@one.net.au> wrote in message

    news:392db408$1@news.devx.com...
    > >>
    > >> Karl,
    > >>
    > >> >I still say it's easier to just upgrade and be done with it! :-)
    > >>
    > >> This code has some advantage in VB5/6. You don't have to go to the

    trouble
    > >> of sorting out where the callback should go from a list of object

    pointers
    > >> + is faster for this reason. Also, the timer is a single class so is

    more
    > >> encapsulated.
    > >>
    > >> Michael Culley
    > >>
    > >> "Karl E. Peterson" <karl@mvps.org> wrote:
    > >> >Hi Jonathan / Jason / Mike --
    > >> >
    > >> >> I for one would not assume this code will always work reliably given

    > what
    > >> I
    > >> >> know. Maybe if I get some time, I'll try to go through it some time.
    > >> >
    > >> >I still say it's easier to just upgrade and be done with it! :-)
    > >> >
    > >> >Later... Karl
    > >> >--
    > >> >http://www.mvps.org/vb
    > >> >
    > >> >
    > >> >
    > >>

    > >
    > >

    >




  4. #49
    Michael \(michka\) Kaplan Guest

    Re: callback function

    Karl did say:

    >I don't dispute it isn't interesting, but it's clear that the disadvantages
    > far outweigh any advantages it may or may not offer. Just my
    > opinion, of course.


    I am still forced to agree here.

    VB4 is such an uncompelling platform for other reasons that I just can't say
    I would be eager to use it anyway...

    Just my opinion, feel free to disagree. :-)

    --
    MichKa
    "Cause it's a bittersweet symphony, thats life..." -- The Verve

    random junk of dubious value, at the multilingual,
    no scripts required, http://www.trigeminal.com/

    "Michael Culley" <m_culley@one.net.au> wrote in message
    news:3937adfd$1@news.devx.com...
    >
    > To everyone who downloaded this example before,
    >
    > I have updated it and made it far far simpler. It contains only three

    lines
    > of assembly code now. The Class_Initialise is much simpler and has been

    seperated
    > out into functions (such as VarPtr function and function to get address

    from
    > VTable).
    >
    > It even contains comments
    >
    > Michael Culley
    >
    > Address is VBDotCom.Com, click on free code, it is the last item in the

    list.
    >
    >
    > "Karl E. Peterson" <karl@mvps.org> wrote:
    > >Hi Mike --
    > >
    > >I don't dispute it isn't interesting, but it's clear that the

    disadvantages
    > far
    > >outweigh any advantages it may or may not offer. Just my opinion, of

    course.
    > >
    > >Later... Karl
    > >--
    > >http://www.mvps.org/vb
    > >
    > >
    > >"Mike Culley" <m_culley@one.net.au> wrote in message

    news:392db408$1@news.devx.com...
    > >>
    > >> Karl,
    > >>
    > >> >I still say it's easier to just upgrade and be done with it! :-)
    > >>
    > >> This code has some advantage in VB5/6. You don't have to go to the

    trouble
    > >> of sorting out where the callback should go from a list of object

    pointers
    > >> + is faster for this reason. Also, the timer is a single class so is

    more
    > >> encapsulated.
    > >>
    > >> Michael Culley
    > >>
    > >> "Karl E. Peterson" <karl@mvps.org> wrote:
    > >> >Hi Jonathan / Jason / Mike --
    > >> >
    > >> >> I for one would not assume this code will always work reliably given

    > what
    > >> I
    > >> >> know. Maybe if I get some time, I'll try to go through it some time.
    > >> >
    > >> >I still say it's easier to just upgrade and be done with it! :-)
    > >> >
    > >> >Later... Karl
    > >> >--
    > >> >http://www.mvps.org/vb
    > >> >
    > >> >
    > >> >
    > >>

    > >
    > >

    >




  5. #50
    Michael Culley Guest

    Re: callback function


    Michael,

    >Just my opinion


    I welcome your opinion and on the VB4 issue I agree. But the point of this
    code was to disprove a myth started by Dan Appleman - that this sort of thing
    could not be done, until VB5 arrived, without the aid of his tools. In this
    way, my code fulfilled its purpose.

    >> feel free to disagree. :-)


    Cool, always happy to do that

    This code was adapted from my subclasser for vb5/6. The original reason I
    wrote this code was to make my subclasser as fast as possible (AFAP?). I
    found that for the paint message, every control had to look up a list of
    function pointers and then a list of messages. I wanted my control to paint
    itself as fast as possible. This method was quicker for 2 reasons. First
    you didn't have to look up the list of function pointers and second, the
    assembly code looked up the list of messages and rejected unwanted messages.
    This would be especially useful for app-wide hooks, which can slow down an
    app.

    I don't dispute its disadvantages, but my design criteria was "as fast as
    possible".

    Michael Culley

    "Michael \(michka\) Kaplan" <former_mvp@spamfree.trigeminal.nospam.com> wrote:
    >Karl did say:
    >
    >>I don't dispute it isn't interesting, but it's clear that the disadvantages
    >> far outweigh any advantages it may or may not offer. Just my
    >> opinion, of course.

    >
    >I am still forced to agree here.
    >
    >VB4 is such an uncompelling platform for other reasons that I just can't

    say
    >I would be eager to use it anyway...
    >
    >Just my opinion, feel free to disagree. :-)
    >
    >--
    >MichKa
    >"Cause it's a bittersweet symphony, thats life..." -- The Verve
    >
    >random junk of dubious value, at the multilingual,
    >no scripts required, http://www.trigeminal.com/
    >
    >"Michael Culley" <m_culley@one.net.au> wrote in message
    >news:3937adfd$1@news.devx.com...
    >>
    >> To everyone who downloaded this example before,
    >>
    >> I have updated it and made it far far simpler. It contains only three

    >lines
    >> of assembly code now. The Class_Initialise is much simpler and has been

    >seperated
    >> out into functions (such as VarPtr function and function to get address

    >from
    >> VTable).
    >>
    >> It even contains comments
    >>
    >> Michael Culley
    >>
    >> Address is VBDotCom.Com, click on free code, it is the last item in the

    >list.
    >>
    >>
    >> "Karl E. Peterson" <karl@mvps.org> wrote:
    >> >Hi Mike --
    >> >
    >> >I don't dispute it isn't interesting, but it's clear that the

    >disadvantages
    >> far
    >> >outweigh any advantages it may or may not offer. Just my opinion, of

    >course.
    >> >
    >> >Later... Karl
    >> >--
    >> >http://www.mvps.org/vb
    >> >
    >> >
    >> >"Mike Culley" <m_culley@one.net.au> wrote in message

    >news:392db408$1@news.devx.com...
    >> >>
    >> >> Karl,
    >> >>
    >> >> >I still say it's easier to just upgrade and be done with it! :-)
    >> >>
    >> >> This code has some advantage in VB5/6. You don't have to go to the

    >trouble
    >> >> of sorting out where the callback should go from a list of object

    >pointers
    >> >> + is faster for this reason. Also, the timer is a single class so is

    >more
    >> >> encapsulated.
    >> >>
    >> >> Michael Culley
    >> >>
    >> >> "Karl E. Peterson" <karl@mvps.org> wrote:
    >> >> >Hi Jonathan / Jason / Mike --
    >> >> >
    >> >> >> I for one would not assume this code will always work reliably given

    >> what
    >> >> I
    >> >> >> know. Maybe if I get some time, I'll try to go through it some time.
    >> >> >
    >> >> >I still say it's easier to just upgrade and be done with it! :-)
    >> >> >
    >> >> >Later... Karl
    >> >> >--
    >> >> >http://www.mvps.org/vb
    >> >> >
    >> >> >
    >> >> >
    >> >>
    >> >
    >> >

    >>

    >
    >



  6. #51
    Michael Culley Guest

    Re: callback function


    Michael,

    >Just my opinion


    I welcome your opinion and on the VB4 issue I agree. But the point of this
    code was to disprove a myth started by Dan Appleman - that this sort of thing
    could not be done, until VB5 arrived, without the aid of his tools. In this
    way, my code fulfilled its purpose.

    >> feel free to disagree. :-)


    Cool, always happy to do that

    This code was adapted from my subclasser for vb5/6. The original reason I
    wrote this code was to make my subclasser as fast as possible (AFAP?). I
    found that for the paint message, every control had to look up a list of
    function pointers and then a list of messages. I wanted my control to paint
    itself as fast as possible. This method was quicker for 2 reasons. First
    you didn't have to look up the list of function pointers and second, the
    assembly code looked up the list of messages and rejected unwanted messages.
    This would be especially useful for app-wide hooks, which can slow down an
    app.

    I don't dispute its disadvantages, but my design criteria was "as fast as
    possible".

    Michael Culley

    "Michael \(michka\) Kaplan" <former_mvp@spamfree.trigeminal.nospam.com> wrote:
    >Karl did say:
    >
    >>I don't dispute it isn't interesting, but it's clear that the disadvantages
    >> far outweigh any advantages it may or may not offer. Just my
    >> opinion, of course.

    >
    >I am still forced to agree here.
    >
    >VB4 is such an uncompelling platform for other reasons that I just can't

    say
    >I would be eager to use it anyway...
    >
    >Just my opinion, feel free to disagree. :-)
    >
    >--
    >MichKa
    >"Cause it's a bittersweet symphony, thats life..." -- The Verve
    >
    >random junk of dubious value, at the multilingual,
    >no scripts required, http://www.trigeminal.com/
    >
    >"Michael Culley" <m_culley@one.net.au> wrote in message
    >news:3937adfd$1@news.devx.com...
    >>
    >> To everyone who downloaded this example before,
    >>
    >> I have updated it and made it far far simpler. It contains only three

    >lines
    >> of assembly code now. The Class_Initialise is much simpler and has been

    >seperated
    >> out into functions (such as VarPtr function and function to get address

    >from
    >> VTable).
    >>
    >> It even contains comments
    >>
    >> Michael Culley
    >>
    >> Address is VBDotCom.Com, click on free code, it is the last item in the

    >list.
    >>
    >>
    >> "Karl E. Peterson" <karl@mvps.org> wrote:
    >> >Hi Mike --
    >> >
    >> >I don't dispute it isn't interesting, but it's clear that the

    >disadvantages
    >> far
    >> >outweigh any advantages it may or may not offer. Just my opinion, of

    >course.
    >> >
    >> >Later... Karl
    >> >--
    >> >http://www.mvps.org/vb
    >> >
    >> >
    >> >"Mike Culley" <m_culley@one.net.au> wrote in message

    >news:392db408$1@news.devx.com...
    >> >>
    >> >> Karl,
    >> >>
    >> >> >I still say it's easier to just upgrade and be done with it! :-)
    >> >>
    >> >> This code has some advantage in VB5/6. You don't have to go to the

    >trouble
    >> >> of sorting out where the callback should go from a list of object

    >pointers
    >> >> + is faster for this reason. Also, the timer is a single class so is

    >more
    >> >> encapsulated.
    >> >>
    >> >> Michael Culley
    >> >>
    >> >> "Karl E. Peterson" <karl@mvps.org> wrote:
    >> >> >Hi Jonathan / Jason / Mike --
    >> >> >
    >> >> >> I for one would not assume this code will always work reliably given

    >> what
    >> >> I
    >> >> >> know. Maybe if I get some time, I'll try to go through it some time.
    >> >> >
    >> >> >I still say it's easier to just upgrade and be done with it! :-)
    >> >> >
    >> >> >Later... Karl
    >> >> >--
    >> >> >http://www.mvps.org/vb
    >> >> >
    >> >> >
    >> >> >
    >> >>
    >> >
    >> >

    >>

    >
    >



  7. #52
    Michael \(michka\) Kaplan Guest

    Re: callback function

    Actually, Dan is mostly wrong about most of this stuff. And he is very
    dismissive of any free methodology that competes with tools that he sells
    (as you noted). Has this not always been true?

    He has an "epic" paper that people still quote as a definitive source on the
    use of CreateThread in VB, even though the paper is entirely irrelevant to
    all of VB6 and all of VB5 prior to SP2.... and the versions it is relevant
    to, he is wrong about. He does not seem to be in any hurry to correct the
    problems or expand the paper, though.

    Dan Appleman is a very talented writer and speaker (and programmer!), but
    his need to cling to his opinions even after they have been disproved can
    definitely hurt his professional reputation.

    --
    MichKa
    "Cause it's a bittersweet symphony, thats life..." -- The Verve

    random junk of dubious value, at the multilingual,
    no scripts required, http://www.trigeminal.com/

    "Michael Culley" <m_culley@one.net.au> wrote in message
    news:3938d49a$1@news.devx.com...
    >
    > Michael,
    >
    > >Just my opinion

    >
    > I welcome your opinion and on the VB4 issue I agree. But the point of this
    > code was to disprove a myth started by Dan Appleman - that this sort of

    thing
    > could not be done, until VB5 arrived, without the aid of his tools. In

    this
    > way, my code fulfilled its purpose.
    >
    > >> feel free to disagree. :-)

    >
    > Cool, always happy to do that
    >
    > This code was adapted from my subclasser for vb5/6. The original reason I
    > wrote this code was to make my subclasser as fast as possible (AFAP?). I
    > found that for the paint message, every control had to look up a list of
    > function pointers and then a list of messages. I wanted my control to

    paint
    > itself as fast as possible. This method was quicker for 2 reasons. First
    > you didn't have to look up the list of function pointers and second, the
    > assembly code looked up the list of messages and rejected unwanted

    messages.
    > This would be especially useful for app-wide hooks, which can slow down an
    > app.
    >
    > I don't dispute its disadvantages, but my design criteria was "as fast as
    > possible".
    >
    > Michael Culley
    >
    > "Michael \(michka\) Kaplan" <former_mvp@spamfree.trigeminal.nospam.com>

    wrote:
    > >Karl did say:
    > >
    > >>I don't dispute it isn't interesting, but it's clear that the

    disadvantages
    > >> far outweigh any advantages it may or may not offer. Just my
    > >> opinion, of course.

    > >
    > >I am still forced to agree here.
    > >
    > >VB4 is such an uncompelling platform for other reasons that I just can't

    > say
    > >I would be eager to use it anyway...
    > >
    > >Just my opinion, feel free to disagree. :-)
    > >
    > >--
    > >MichKa
    > >"Cause it's a bittersweet symphony, thats life..." -- The Verve
    > >
    > >random junk of dubious value, at the multilingual,
    > >no scripts required, http://www.trigeminal.com/
    > >
    > >"Michael Culley" <m_culley@one.net.au> wrote in message
    > >news:3937adfd$1@news.devx.com...
    > >>
    > >> To everyone who downloaded this example before,
    > >>
    > >> I have updated it and made it far far simpler. It contains only three

    > >lines
    > >> of assembly code now. The Class_Initialise is much simpler and has been

    > >seperated
    > >> out into functions (such as VarPtr function and function to get address

    > >from
    > >> VTable).
    > >>
    > >> It even contains comments
    > >>
    > >> Michael Culley
    > >>
    > >> Address is VBDotCom.Com, click on free code, it is the last item in the

    > >list.
    > >>
    > >>
    > >> "Karl E. Peterson" <karl@mvps.org> wrote:
    > >> >Hi Mike --
    > >> >
    > >> >I don't dispute it isn't interesting, but it's clear that the

    > >disadvantages
    > >> far
    > >> >outweigh any advantages it may or may not offer. Just my opinion, of

    > >course.
    > >> >
    > >> >Later... Karl
    > >> >--
    > >> >http://www.mvps.org/vb
    > >> >
    > >> >
    > >> >"Mike Culley" <m_culley@one.net.au> wrote in message

    > >news:392db408$1@news.devx.com...
    > >> >>
    > >> >> Karl,
    > >> >>
    > >> >> >I still say it's easier to just upgrade and be done with it! :-)
    > >> >>
    > >> >> This code has some advantage in VB5/6. You don't have to go to the

    > >trouble
    > >> >> of sorting out where the callback should go from a list of object

    > >pointers
    > >> >> + is faster for this reason. Also, the timer is a single class so is

    > >more
    > >> >> encapsulated.
    > >> >>
    > >> >> Michael Culley
    > >> >>
    > >> >> "Karl E. Peterson" <karl@mvps.org> wrote:
    > >> >> >Hi Jonathan / Jason / Mike --
    > >> >> >
    > >> >> >> I for one would not assume this code will always work reliably

    given
    > >> what
    > >> >> I
    > >> >> >> know. Maybe if I get some time, I'll try to go through it some

    time.
    > >> >> >
    > >> >> >I still say it's easier to just upgrade and be done with it! :-)
    > >> >> >
    > >> >> >Later... Karl
    > >> >> >--
    > >> >> >http://www.mvps.org/vb
    > >> >> >
    > >> >> >
    > >> >> >
    > >> >>
    > >> >
    > >> >
    > >>

    > >
    > >

    >




  8. #53
    Michael \(michka\) Kaplan Guest

    Re: callback function

    Actually, Dan is mostly wrong about most of this stuff. And he is very
    dismissive of any free methodology that competes with tools that he sells
    (as you noted). Has this not always been true?

    He has an "epic" paper that people still quote as a definitive source on the
    use of CreateThread in VB, even though the paper is entirely irrelevant to
    all of VB6 and all of VB5 prior to SP2.... and the versions it is relevant
    to, he is wrong about. He does not seem to be in any hurry to correct the
    problems or expand the paper, though.

    Dan Appleman is a very talented writer and speaker (and programmer!), but
    his need to cling to his opinions even after they have been disproved can
    definitely hurt his professional reputation.

    --
    MichKa
    "Cause it's a bittersweet symphony, thats life..." -- The Verve

    random junk of dubious value, at the multilingual,
    no scripts required, http://www.trigeminal.com/

    "Michael Culley" <m_culley@one.net.au> wrote in message
    news:3938d49a$1@news.devx.com...
    >
    > Michael,
    >
    > >Just my opinion

    >
    > I welcome your opinion and on the VB4 issue I agree. But the point of this
    > code was to disprove a myth started by Dan Appleman - that this sort of

    thing
    > could not be done, until VB5 arrived, without the aid of his tools. In

    this
    > way, my code fulfilled its purpose.
    >
    > >> feel free to disagree. :-)

    >
    > Cool, always happy to do that
    >
    > This code was adapted from my subclasser for vb5/6. The original reason I
    > wrote this code was to make my subclasser as fast as possible (AFAP?). I
    > found that for the paint message, every control had to look up a list of
    > function pointers and then a list of messages. I wanted my control to

    paint
    > itself as fast as possible. This method was quicker for 2 reasons. First
    > you didn't have to look up the list of function pointers and second, the
    > assembly code looked up the list of messages and rejected unwanted

    messages.
    > This would be especially useful for app-wide hooks, which can slow down an
    > app.
    >
    > I don't dispute its disadvantages, but my design criteria was "as fast as
    > possible".
    >
    > Michael Culley
    >
    > "Michael \(michka\) Kaplan" <former_mvp@spamfree.trigeminal.nospam.com>

    wrote:
    > >Karl did say:
    > >
    > >>I don't dispute it isn't interesting, but it's clear that the

    disadvantages
    > >> far outweigh any advantages it may or may not offer. Just my
    > >> opinion, of course.

    > >
    > >I am still forced to agree here.
    > >
    > >VB4 is such an uncompelling platform for other reasons that I just can't

    > say
    > >I would be eager to use it anyway...
    > >
    > >Just my opinion, feel free to disagree. :-)
    > >
    > >--
    > >MichKa
    > >"Cause it's a bittersweet symphony, thats life..." -- The Verve
    > >
    > >random junk of dubious value, at the multilingual,
    > >no scripts required, http://www.trigeminal.com/
    > >
    > >"Michael Culley" <m_culley@one.net.au> wrote in message
    > >news:3937adfd$1@news.devx.com...
    > >>
    > >> To everyone who downloaded this example before,
    > >>
    > >> I have updated it and made it far far simpler. It contains only three

    > >lines
    > >> of assembly code now. The Class_Initialise is much simpler and has been

    > >seperated
    > >> out into functions (such as VarPtr function and function to get address

    > >from
    > >> VTable).
    > >>
    > >> It even contains comments
    > >>
    > >> Michael Culley
    > >>
    > >> Address is VBDotCom.Com, click on free code, it is the last item in the

    > >list.
    > >>
    > >>
    > >> "Karl E. Peterson" <karl@mvps.org> wrote:
    > >> >Hi Mike --
    > >> >
    > >> >I don't dispute it isn't interesting, but it's clear that the

    > >disadvantages
    > >> far
    > >> >outweigh any advantages it may or may not offer. Just my opinion, of

    > >course.
    > >> >
    > >> >Later... Karl
    > >> >--
    > >> >http://www.mvps.org/vb
    > >> >
    > >> >
    > >> >"Mike Culley" <m_culley@one.net.au> wrote in message

    > >news:392db408$1@news.devx.com...
    > >> >>
    > >> >> Karl,
    > >> >>
    > >> >> >I still say it's easier to just upgrade and be done with it! :-)
    > >> >>
    > >> >> This code has some advantage in VB5/6. You don't have to go to the

    > >trouble
    > >> >> of sorting out where the callback should go from a list of object

    > >pointers
    > >> >> + is faster for this reason. Also, the timer is a single class so is

    > >more
    > >> >> encapsulated.
    > >> >>
    > >> >> Michael Culley
    > >> >>
    > >> >> "Karl E. Peterson" <karl@mvps.org> wrote:
    > >> >> >Hi Jonathan / Jason / Mike --
    > >> >> >
    > >> >> >> I for one would not assume this code will always work reliably

    given
    > >> what
    > >> >> I
    > >> >> >> know. Maybe if I get some time, I'll try to go through it some

    time.
    > >> >> >
    > >> >> >I still say it's easier to just upgrade and be done with it! :-)
    > >> >> >
    > >> >> >Later... Karl
    > >> >> >--
    > >> >> >http://www.mvps.org/vb
    > >> >> >
    > >> >> >
    > >> >> >
    > >> >>
    > >> >
    > >> >
    > >>

    > >
    > >

    >




  9. #54
    Michael Culley Guest

    Re: callback function


    >but
    >his need to cling to his opinions even after they have been
    >disproved can
    >definitely hurt his professional reputation.


    I think that Dan has definately had a positive contribution to the VB world.
    I have read a couple of his books and found them very well written and educational.
    But I think he is a bit too driven by $. He didn't go into subclassing very
    thouroughly in his API book. Suprise suprise, he sells a subclassing control.

    In his ActiveX book he promised in one of the early chapters to turn me into
    a COM guru. I Learnt a fair bit but I'm still no COM guru.

    Michael Culley



    "Michael \(michka\) Kaplan" <former_mvp@spamfree.trigeminal.nospam.com> wrote:
    >Actually, Dan is mostly wrong about most of this stuff. And he is very
    >dismissive of any free methodology that competes with tools that he sells
    >(as you noted). Has this not always been true?
    >
    >He has an "epic" paper that people still quote as a definitive source on

    the
    >use of CreateThread in VB, even though the paper is entirely irrelevant

    to
    >all of VB6 and all of VB5 prior to SP2.... and the versions it is relevant
    >to, he is wrong about. He does not seem to be in any hurry to correct the
    >problems or expand the paper, though.
    >
    >Dan Appleman is a very talented writer and speaker (and programmer!), but
    >his need to cling to his opinions even after they have been disproved can
    >definitely hurt his professional reputation.
    >
    >--
    >MichKa
    >"Cause it's a bittersweet symphony, thats life..." -- The Verve
    >
    >random junk of dubious value, at the multilingual,
    >no scripts required, http://www.trigeminal.com/
    >
    >"Michael Culley" <m_culley@one.net.au> wrote in message
    >news:3938d49a$1@news.devx.com...
    >>
    >> Michael,
    >>
    >> >Just my opinion

    >>
    >> I welcome your opinion and on the VB4 issue I agree. But the point of

    this
    >> code was to disprove a myth started by Dan Appleman - that this sort of

    >thing
    >> could not be done, until VB5 arrived, without the aid of his tools. In

    >this
    >> way, my code fulfilled its purpose.
    >>
    >> >> feel free to disagree. :-)

    >>
    >> Cool, always happy to do that
    >>
    >> This code was adapted from my subclasser for vb5/6. The original reason

    I
    >> wrote this code was to make my subclasser as fast as possible (AFAP?).

    I
    >> found that for the paint message, every control had to look up a list

    of
    >> function pointers and then a list of messages. I wanted my control to

    >paint
    >> itself as fast as possible. This method was quicker for 2 reasons. First
    >> you didn't have to look up the list of function pointers and second, the
    >> assembly code looked up the list of messages and rejected unwanted

    >messages.
    >> This would be especially useful for app-wide hooks, which can slow down

    an
    >> app.
    >>
    >> I don't dispute its disadvantages, but my design criteria was "as fast

    as
    >> possible".
    >>
    >> Michael Culley
    >>
    >> "Michael \(michka\) Kaplan" <former_mvp@spamfree.trigeminal.nospam.com>

    >wrote:
    >> >Karl did say:
    >> >
    >> >>I don't dispute it isn't interesting, but it's clear that the

    >disadvantages
    >> >> far outweigh any advantages it may or may not offer. Just my
    >> >> opinion, of course.
    >> >
    >> >I am still forced to agree here.
    >> >
    >> >VB4 is such an uncompelling platform for other reasons that I just can't

    >> say
    >> >I would be eager to use it anyway...
    >> >
    >> >Just my opinion, feel free to disagree. :-)
    >> >
    >> >--
    >> >MichKa
    >> >"Cause it's a bittersweet symphony, thats life..." -- The Verve
    >> >
    >> >random junk of dubious value, at the multilingual,
    >> >no scripts required, http://www.trigeminal.com/
    >> >
    >> >"Michael Culley" <m_culley@one.net.au> wrote in message
    >> >news:3937adfd$1@news.devx.com...
    >> >>
    >> >> To everyone who downloaded this example before,
    >> >>
    >> >> I have updated it and made it far far simpler. It contains only three
    >> >lines
    >> >> of assembly code now. The Class_Initialise is much simpler and has

    been
    >> >seperated
    >> >> out into functions (such as VarPtr function and function to get address
    >> >from
    >> >> VTable).
    >> >>
    >> >> It even contains comments
    >> >>
    >> >> Michael Culley
    >> >>
    >> >> Address is VBDotCom.Com, click on free code, it is the last item in

    the
    >> >list.
    >> >>
    >> >>
    >> >> "Karl E. Peterson" <karl@mvps.org> wrote:
    >> >> >Hi Mike --
    >> >> >
    >> >> >I don't dispute it isn't interesting, but it's clear that the
    >> >disadvantages
    >> >> far
    >> >> >outweigh any advantages it may or may not offer. Just my opinion,

    of
    >> >course.
    >> >> >
    >> >> >Later... Karl
    >> >> >--
    >> >> >http://www.mvps.org/vb
    >> >> >
    >> >> >
    >> >> >"Mike Culley" <m_culley@one.net.au> wrote in message
    >> >news:392db408$1@news.devx.com...
    >> >> >>
    >> >> >> Karl,
    >> >> >>
    >> >> >> >I still say it's easier to just upgrade and be done with it! :-)
    >> >> >>
    >> >> >> This code has some advantage in VB5/6. You don't have to go to the
    >> >trouble
    >> >> >> of sorting out where the callback should go from a list of object
    >> >pointers
    >> >> >> + is faster for this reason. Also, the timer is a single class so

    is
    >> >more
    >> >> >> encapsulated.
    >> >> >>
    >> >> >> Michael Culley
    >> >> >>
    >> >> >> "Karl E. Peterson" <karl@mvps.org> wrote:
    >> >> >> >Hi Jonathan / Jason / Mike --
    >> >> >> >
    >> >> >> >> I for one would not assume this code will always work reliably

    >given
    >> >> what
    >> >> >> I
    >> >> >> >> know. Maybe if I get some time, I'll try to go through it some

    >time.
    >> >> >> >
    >> >> >> >I still say it's easier to just upgrade and be done with it! :-)
    >> >> >> >
    >> >> >> >Later... Karl
    >> >> >> >--
    >> >> >> >http://www.mvps.org/vb
    >> >> >> >
    >> >> >> >
    >> >> >> >
    >> >> >>
    >> >> >
    >> >> >
    >> >>
    >> >
    >> >

    >>

    >
    >



  10. #55
    Michael Culley Guest

    Re: callback function


    >but
    >his need to cling to his opinions even after they have been
    >disproved can
    >definitely hurt his professional reputation.


    I think that Dan has definately had a positive contribution to the VB world.
    I have read a couple of his books and found them very well written and educational.
    But I think he is a bit too driven by $. He didn't go into subclassing very
    thouroughly in his API book. Suprise suprise, he sells a subclassing control.

    In his ActiveX book he promised in one of the early chapters to turn me into
    a COM guru. I Learnt a fair bit but I'm still no COM guru.

    Michael Culley



    "Michael \(michka\) Kaplan" <former_mvp@spamfree.trigeminal.nospam.com> wrote:
    >Actually, Dan is mostly wrong about most of this stuff. And he is very
    >dismissive of any free methodology that competes with tools that he sells
    >(as you noted). Has this not always been true?
    >
    >He has an "epic" paper that people still quote as a definitive source on

    the
    >use of CreateThread in VB, even though the paper is entirely irrelevant

    to
    >all of VB6 and all of VB5 prior to SP2.... and the versions it is relevant
    >to, he is wrong about. He does not seem to be in any hurry to correct the
    >problems or expand the paper, though.
    >
    >Dan Appleman is a very talented writer and speaker (and programmer!), but
    >his need to cling to his opinions even after they have been disproved can
    >definitely hurt his professional reputation.
    >
    >--
    >MichKa
    >"Cause it's a bittersweet symphony, thats life..." -- The Verve
    >
    >random junk of dubious value, at the multilingual,
    >no scripts required, http://www.trigeminal.com/
    >
    >"Michael Culley" <m_culley@one.net.au> wrote in message
    >news:3938d49a$1@news.devx.com...
    >>
    >> Michael,
    >>
    >> >Just my opinion

    >>
    >> I welcome your opinion and on the VB4 issue I agree. But the point of

    this
    >> code was to disprove a myth started by Dan Appleman - that this sort of

    >thing
    >> could not be done, until VB5 arrived, without the aid of his tools. In

    >this
    >> way, my code fulfilled its purpose.
    >>
    >> >> feel free to disagree. :-)

    >>
    >> Cool, always happy to do that
    >>
    >> This code was adapted from my subclasser for vb5/6. The original reason

    I
    >> wrote this code was to make my subclasser as fast as possible (AFAP?).

    I
    >> found that for the paint message, every control had to look up a list

    of
    >> function pointers and then a list of messages. I wanted my control to

    >paint
    >> itself as fast as possible. This method was quicker for 2 reasons. First
    >> you didn't have to look up the list of function pointers and second, the
    >> assembly code looked up the list of messages and rejected unwanted

    >messages.
    >> This would be especially useful for app-wide hooks, which can slow down

    an
    >> app.
    >>
    >> I don't dispute its disadvantages, but my design criteria was "as fast

    as
    >> possible".
    >>
    >> Michael Culley
    >>
    >> "Michael \(michka\) Kaplan" <former_mvp@spamfree.trigeminal.nospam.com>

    >wrote:
    >> >Karl did say:
    >> >
    >> >>I don't dispute it isn't interesting, but it's clear that the

    >disadvantages
    >> >> far outweigh any advantages it may or may not offer. Just my
    >> >> opinion, of course.
    >> >
    >> >I am still forced to agree here.
    >> >
    >> >VB4 is such an uncompelling platform for other reasons that I just can't

    >> say
    >> >I would be eager to use it anyway...
    >> >
    >> >Just my opinion, feel free to disagree. :-)
    >> >
    >> >--
    >> >MichKa
    >> >"Cause it's a bittersweet symphony, thats life..." -- The Verve
    >> >
    >> >random junk of dubious value, at the multilingual,
    >> >no scripts required, http://www.trigeminal.com/
    >> >
    >> >"Michael Culley" <m_culley@one.net.au> wrote in message
    >> >news:3937adfd$1@news.devx.com...
    >> >>
    >> >> To everyone who downloaded this example before,
    >> >>
    >> >> I have updated it and made it far far simpler. It contains only three
    >> >lines
    >> >> of assembly code now. The Class_Initialise is much simpler and has

    been
    >> >seperated
    >> >> out into functions (such as VarPtr function and function to get address
    >> >from
    >> >> VTable).
    >> >>
    >> >> It even contains comments
    >> >>
    >> >> Michael Culley
    >> >>
    >> >> Address is VBDotCom.Com, click on free code, it is the last item in

    the
    >> >list.
    >> >>
    >> >>
    >> >> "Karl E. Peterson" <karl@mvps.org> wrote:
    >> >> >Hi Mike --
    >> >> >
    >> >> >I don't dispute it isn't interesting, but it's clear that the
    >> >disadvantages
    >> >> far
    >> >> >outweigh any advantages it may or may not offer. Just my opinion,

    of
    >> >course.
    >> >> >
    >> >> >Later... Karl
    >> >> >--
    >> >> >http://www.mvps.org/vb
    >> >> >
    >> >> >
    >> >> >"Mike Culley" <m_culley@one.net.au> wrote in message
    >> >news:392db408$1@news.devx.com...
    >> >> >>
    >> >> >> Karl,
    >> >> >>
    >> >> >> >I still say it's easier to just upgrade and be done with it! :-)
    >> >> >>
    >> >> >> This code has some advantage in VB5/6. You don't have to go to the
    >> >trouble
    >> >> >> of sorting out where the callback should go from a list of object
    >> >pointers
    >> >> >> + is faster for this reason. Also, the timer is a single class so

    is
    >> >more
    >> >> >> encapsulated.
    >> >> >>
    >> >> >> Michael Culley
    >> >> >>
    >> >> >> "Karl E. Peterson" <karl@mvps.org> wrote:
    >> >> >> >Hi Jonathan / Jason / Mike --
    >> >> >> >
    >> >> >> >> I for one would not assume this code will always work reliably

    >given
    >> >> what
    >> >> >> I
    >> >> >> >> know. Maybe if I get some time, I'll try to go through it some

    >time.
    >> >> >> >
    >> >> >> >I still say it's easier to just upgrade and be done with it! :-)
    >> >> >> >
    >> >> >> >Later... Karl
    >> >> >> >--
    >> >> >> >http://www.mvps.org/vb
    >> >> >> >
    >> >> >> >
    >> >> >> >
    >> >> >>
    >> >> >
    >> >> >
    >> >>
    >> >
    >> >

    >>

    >
    >



  11. #56
    Michael \(michka\) Kaplan Guest

    Re: callback function

    There is no question that good has come from him, defiinitely. I think you
    put you finger on the problem, though. :-)

    --
    MichKa
    "Cause it's a bittersweet symphony, thats life..." -- The Verve

    random junk of dubious value, at the multilingual,
    no scripts required, http://www.trigeminal.com/

    "Michael Culley" <m_culley@one.net.au> wrote in message
    news:393a2867$1@news.devx.com...
    >
    > >but
    > >his need to cling to his opinions even after they have been
    > >disproved can
    > >definitely hurt his professional reputation.

    >
    > I think that Dan has definately had a positive contribution to the VB

    world.
    > I have read a couple of his books and found them very well written and

    educational.
    > But I think he is a bit too driven by $. He didn't go into subclassing

    very
    > thouroughly in his API book. Suprise suprise, he sells a subclassing

    control.
    >
    > In his ActiveX book he promised in one of the early chapters to turn me

    into
    > a COM guru. I Learnt a fair bit but I'm still no COM guru.
    >
    > Michael Culley
    >
    >
    >
    > "Michael \(michka\) Kaplan" <former_mvp@spamfree.trigeminal.nospam.com>

    wrote:
    > >Actually, Dan is mostly wrong about most of this stuff. And he is very
    > >dismissive of any free methodology that competes with tools that he sells
    > >(as you noted). Has this not always been true?
    > >
    > >He has an "epic" paper that people still quote as a definitive source on

    > the
    > >use of CreateThread in VB, even though the paper is entirely irrelevant

    > to
    > >all of VB6 and all of VB5 prior to SP2.... and the versions it is

    relevant
    > >to, he is wrong about. He does not seem to be in any hurry to correct the
    > >problems or expand the paper, though.
    > >
    > >Dan Appleman is a very talented writer and speaker (and programmer!), but
    > >his need to cling to his opinions even after they have been disproved can
    > >definitely hurt his professional reputation.
    > >
    > >--
    > >MichKa
    > >"Cause it's a bittersweet symphony, thats life..." -- The Verve
    > >
    > >random junk of dubious value, at the multilingual,
    > >no scripts required, http://www.trigeminal.com/
    > >
    > >"Michael Culley" <m_culley@one.net.au> wrote in message
    > >news:3938d49a$1@news.devx.com...
    > >>
    > >> Michael,
    > >>
    > >> >Just my opinion
    > >>
    > >> I welcome your opinion and on the VB4 issue I agree. But the point of

    > this
    > >> code was to disprove a myth started by Dan Appleman - that this sort of

    > >thing
    > >> could not be done, until VB5 arrived, without the aid of his tools. In

    > >this
    > >> way, my code fulfilled its purpose.
    > >>
    > >> >> feel free to disagree. :-)
    > >>
    > >> Cool, always happy to do that
    > >>
    > >> This code was adapted from my subclasser for vb5/6. The original reason

    > I
    > >> wrote this code was to make my subclasser as fast as possible (AFAP?).

    > I
    > >> found that for the paint message, every control had to look up a list

    > of
    > >> function pointers and then a list of messages. I wanted my control to

    > >paint
    > >> itself as fast as possible. This method was quicker for 2 reasons.

    First
    > >> you didn't have to look up the list of function pointers and second,

    the
    > >> assembly code looked up the list of messages and rejected unwanted

    > >messages.
    > >> This would be especially useful for app-wide hooks, which can slow down

    > an
    > >> app.
    > >>
    > >> I don't dispute its disadvantages, but my design criteria was "as fast

    > as
    > >> possible".
    > >>
    > >> Michael Culley
    > >>
    > >> "Michael \(michka\) Kaplan" <former_mvp@spamfree.trigeminal.nospam.com>

    > >wrote:
    > >> >Karl did say:
    > >> >
    > >> >>I don't dispute it isn't interesting, but it's clear that the

    > >disadvantages
    > >> >> far outweigh any advantages it may or may not offer. Just my
    > >> >> opinion, of course.
    > >> >
    > >> >I am still forced to agree here.
    > >> >
    > >> >VB4 is such an uncompelling platform for other reasons that I just

    can't
    > >> say
    > >> >I would be eager to use it anyway...
    > >> >
    > >> >Just my opinion, feel free to disagree. :-)
    > >> >
    > >> >--
    > >> >MichKa
    > >> >"Cause it's a bittersweet symphony, thats life..." -- The Verve
    > >> >
    > >> >random junk of dubious value, at the multilingual,
    > >> >no scripts required, http://www.trigeminal.com/
    > >> >
    > >> >"Michael Culley" <m_culley@one.net.au> wrote in message
    > >> >news:3937adfd$1@news.devx.com...
    > >> >>
    > >> >> To everyone who downloaded this example before,
    > >> >>
    > >> >> I have updated it and made it far far simpler. It contains only

    three
    > >> >lines
    > >> >> of assembly code now. The Class_Initialise is much simpler and has

    > been
    > >> >seperated
    > >> >> out into functions (such as VarPtr function and function to get

    address
    > >> >from
    > >> >> VTable).
    > >> >>
    > >> >> It even contains comments
    > >> >>
    > >> >> Michael Culley
    > >> >>
    > >> >> Address is VBDotCom.Com, click on free code, it is the last item in

    > the
    > >> >list.
    > >> >>
    > >> >>
    > >> >> "Karl E. Peterson" <karl@mvps.org> wrote:
    > >> >> >Hi Mike --
    > >> >> >
    > >> >> >I don't dispute it isn't interesting, but it's clear that the
    > >> >disadvantages
    > >> >> far
    > >> >> >outweigh any advantages it may or may not offer. Just my opinion,

    > of
    > >> >course.
    > >> >> >
    > >> >> >Later... Karl
    > >> >> >--
    > >> >> >http://www.mvps.org/vb
    > >> >> >
    > >> >> >
    > >> >> >"Mike Culley" <m_culley@one.net.au> wrote in message
    > >> >news:392db408$1@news.devx.com...
    > >> >> >>
    > >> >> >> Karl,
    > >> >> >>
    > >> >> >> >I still say it's easier to just upgrade and be done with it!

    :-)
    > >> >> >>
    > >> >> >> This code has some advantage in VB5/6. You don't have to go to

    the
    > >> >trouble
    > >> >> >> of sorting out where the callback should go from a list of object
    > >> >pointers
    > >> >> >> + is faster for this reason. Also, the timer is a single class so

    > is
    > >> >more
    > >> >> >> encapsulated.
    > >> >> >>
    > >> >> >> Michael Culley
    > >> >> >>
    > >> >> >> "Karl E. Peterson" <karl@mvps.org> wrote:
    > >> >> >> >Hi Jonathan / Jason / Mike --
    > >> >> >> >
    > >> >> >> >> I for one would not assume this code will always work reliably

    > >given
    > >> >> what
    > >> >> >> I
    > >> >> >> >> know. Maybe if I get some time, I'll try to go through it some

    > >time.
    > >> >> >> >
    > >> >> >> >I still say it's easier to just upgrade and be done with it!

    :-)
    > >> >> >> >
    > >> >> >> >Later... Karl
    > >> >> >> >--
    > >> >> >> >http://www.mvps.org/vb
    > >> >> >> >
    > >> >> >> >
    > >> >> >> >
    > >> >> >>
    > >> >> >
    > >> >> >
    > >> >>
    > >> >
    > >> >
    > >>

    > >
    > >

    >




  12. #57
    Michael \(michka\) Kaplan Guest

    Re: callback function

    There is no question that good has come from him, defiinitely. I think you
    put you finger on the problem, though. :-)

    --
    MichKa
    "Cause it's a bittersweet symphony, thats life..." -- The Verve

    random junk of dubious value, at the multilingual,
    no scripts required, http://www.trigeminal.com/

    "Michael Culley" <m_culley@one.net.au> wrote in message
    news:393a2867$1@news.devx.com...
    >
    > >but
    > >his need to cling to his opinions even after they have been
    > >disproved can
    > >definitely hurt his professional reputation.

    >
    > I think that Dan has definately had a positive contribution to the VB

    world.
    > I have read a couple of his books and found them very well written and

    educational.
    > But I think he is a bit too driven by $. He didn't go into subclassing

    very
    > thouroughly in his API book. Suprise suprise, he sells a subclassing

    control.
    >
    > In his ActiveX book he promised in one of the early chapters to turn me

    into
    > a COM guru. I Learnt a fair bit but I'm still no COM guru.
    >
    > Michael Culley
    >
    >
    >
    > "Michael \(michka\) Kaplan" <former_mvp@spamfree.trigeminal.nospam.com>

    wrote:
    > >Actually, Dan is mostly wrong about most of this stuff. And he is very
    > >dismissive of any free methodology that competes with tools that he sells
    > >(as you noted). Has this not always been true?
    > >
    > >He has an "epic" paper that people still quote as a definitive source on

    > the
    > >use of CreateThread in VB, even though the paper is entirely irrelevant

    > to
    > >all of VB6 and all of VB5 prior to SP2.... and the versions it is

    relevant
    > >to, he is wrong about. He does not seem to be in any hurry to correct the
    > >problems or expand the paper, though.
    > >
    > >Dan Appleman is a very talented writer and speaker (and programmer!), but
    > >his need to cling to his opinions even after they have been disproved can
    > >definitely hurt his professional reputation.
    > >
    > >--
    > >MichKa
    > >"Cause it's a bittersweet symphony, thats life..." -- The Verve
    > >
    > >random junk of dubious value, at the multilingual,
    > >no scripts required, http://www.trigeminal.com/
    > >
    > >"Michael Culley" <m_culley@one.net.au> wrote in message
    > >news:3938d49a$1@news.devx.com...
    > >>
    > >> Michael,
    > >>
    > >> >Just my opinion
    > >>
    > >> I welcome your opinion and on the VB4 issue I agree. But the point of

    > this
    > >> code was to disprove a myth started by Dan Appleman - that this sort of

    > >thing
    > >> could not be done, until VB5 arrived, without the aid of his tools. In

    > >this
    > >> way, my code fulfilled its purpose.
    > >>
    > >> >> feel free to disagree. :-)
    > >>
    > >> Cool, always happy to do that
    > >>
    > >> This code was adapted from my subclasser for vb5/6. The original reason

    > I
    > >> wrote this code was to make my subclasser as fast as possible (AFAP?).

    > I
    > >> found that for the paint message, every control had to look up a list

    > of
    > >> function pointers and then a list of messages. I wanted my control to

    > >paint
    > >> itself as fast as possible. This method was quicker for 2 reasons.

    First
    > >> you didn't have to look up the list of function pointers and second,

    the
    > >> assembly code looked up the list of messages and rejected unwanted

    > >messages.
    > >> This would be especially useful for app-wide hooks, which can slow down

    > an
    > >> app.
    > >>
    > >> I don't dispute its disadvantages, but my design criteria was "as fast

    > as
    > >> possible".
    > >>
    > >> Michael Culley
    > >>
    > >> "Michael \(michka\) Kaplan" <former_mvp@spamfree.trigeminal.nospam.com>

    > >wrote:
    > >> >Karl did say:
    > >> >
    > >> >>I don't dispute it isn't interesting, but it's clear that the

    > >disadvantages
    > >> >> far outweigh any advantages it may or may not offer. Just my
    > >> >> opinion, of course.
    > >> >
    > >> >I am still forced to agree here.
    > >> >
    > >> >VB4 is such an uncompelling platform for other reasons that I just

    can't
    > >> say
    > >> >I would be eager to use it anyway...
    > >> >
    > >> >Just my opinion, feel free to disagree. :-)
    > >> >
    > >> >--
    > >> >MichKa
    > >> >"Cause it's a bittersweet symphony, thats life..." -- The Verve
    > >> >
    > >> >random junk of dubious value, at the multilingual,
    > >> >no scripts required, http://www.trigeminal.com/
    > >> >
    > >> >"Michael Culley" <m_culley@one.net.au> wrote in message
    > >> >news:3937adfd$1@news.devx.com...
    > >> >>
    > >> >> To everyone who downloaded this example before,
    > >> >>
    > >> >> I have updated it and made it far far simpler. It contains only

    three
    > >> >lines
    > >> >> of assembly code now. The Class_Initialise is much simpler and has

    > been
    > >> >seperated
    > >> >> out into functions (such as VarPtr function and function to get

    address
    > >> >from
    > >> >> VTable).
    > >> >>
    > >> >> It even contains comments
    > >> >>
    > >> >> Michael Culley
    > >> >>
    > >> >> Address is VBDotCom.Com, click on free code, it is the last item in

    > the
    > >> >list.
    > >> >>
    > >> >>
    > >> >> "Karl E. Peterson" <karl@mvps.org> wrote:
    > >> >> >Hi Mike --
    > >> >> >
    > >> >> >I don't dispute it isn't interesting, but it's clear that the
    > >> >disadvantages
    > >> >> far
    > >> >> >outweigh any advantages it may or may not offer. Just my opinion,

    > of
    > >> >course.
    > >> >> >
    > >> >> >Later... Karl
    > >> >> >--
    > >> >> >http://www.mvps.org/vb
    > >> >> >
    > >> >> >
    > >> >> >"Mike Culley" <m_culley@one.net.au> wrote in message
    > >> >news:392db408$1@news.devx.com...
    > >> >> >>
    > >> >> >> Karl,
    > >> >> >>
    > >> >> >> >I still say it's easier to just upgrade and be done with it!

    :-)
    > >> >> >>
    > >> >> >> This code has some advantage in VB5/6. You don't have to go to

    the
    > >> >trouble
    > >> >> >> of sorting out where the callback should go from a list of object
    > >> >pointers
    > >> >> >> + is faster for this reason. Also, the timer is a single class so

    > is
    > >> >more
    > >> >> >> encapsulated.
    > >> >> >>
    > >> >> >> Michael Culley
    > >> >> >>
    > >> >> >> "Karl E. Peterson" <karl@mvps.org> wrote:
    > >> >> >> >Hi Jonathan / Jason / Mike --
    > >> >> >> >
    > >> >> >> >> I for one would not assume this code will always work reliably

    > >given
    > >> >> what
    > >> >> >> I
    > >> >> >> >> know. Maybe if I get some time, I'll try to go through it some

    > >time.
    > >> >> >> >
    > >> >> >> >I still say it's easier to just upgrade and be done with it!

    :-)
    > >> >> >> >
    > >> >> >> >Later... Karl
    > >> >> >> >--
    > >> >> >> >http://www.mvps.org/vb
    > >> >> >> >
    > >> >> >> >
    > >> >> >> >
    > >> >> >>
    > >> >> >
    > >> >> >
    > >> >>
    > >> >
    > >> >
    > >>

    > >
    > >

    >




  13. #58
    Michael Culley Guest

    Re: callback function


    Jason,

    >Also, since TimerProc is Public, any client can
    >call this method, which is
    >problematic at best. I realize that if you are
    >walking the vtable, you really didn't have a
    >choice in this case, but this leads to programming by
    >convention (i.e. the client has to know not
    >to call this method).


    This is a bit late, but I found a solution to this. If the function is defined
    as private it is still in the VTable, just at the end, so can still be called.

    Michael Culley

    "Jason Bock" <jrbock@execpc.com> wrote:
    >It looks interesting, but your Class_Initialize method is confusing at best,
    >and to me that is where the core of your code is. It ~appears~ that you

    are
    >walking the vtable of your clsTimer object and finding out where your
    >TimerProc method lies, but it's hard to tell. If you could explain just
    >what you are doing and why you are doing all of the CopyMemory calls and

    why
    >you chose all of the values for mbytData, that would help out a lot. Also,
    >since TimerProc is Public, any client can call this method, which is
    >problematic at best. I realize that if you are walking the vtable, you
    >really didn't have a choice in this case, but this leads to programming

    by
    >convention (i.e. the client has to know not to call this method).
    >
    >Also, have you tested this out with any other APIs that require a callback?
    >
    >Regards,
    >
    >Jason
    >
    >"Michael Culley" <m_culley@one.net.au> wrote in message
    >news:392d30a5$1@news.devx.com...
    >>
    >> It is available at
    >>
    >> www.VBDotCom.com
    >>
    >> Click on free code. The timer is the last item in the list.
    >>
    >> It is not necessary to use VB4 to test it, it works also in vb5 and 6.
    >>
    >> Michael Culley

    >
    >
    >



  14. #59
    Michael Culley Guest

    Re: callback function


    Jason,

    >Also, since TimerProc is Public, any client can
    >call this method, which is
    >problematic at best. I realize that if you are
    >walking the vtable, you really didn't have a
    >choice in this case, but this leads to programming by
    >convention (i.e. the client has to know not
    >to call this method).


    This is a bit late, but I found a solution to this. If the function is defined
    as private it is still in the VTable, just at the end, so can still be called.

    Michael Culley

    "Jason Bock" <jrbock@execpc.com> wrote:
    >It looks interesting, but your Class_Initialize method is confusing at best,
    >and to me that is where the core of your code is. It ~appears~ that you

    are
    >walking the vtable of your clsTimer object and finding out where your
    >TimerProc method lies, but it's hard to tell. If you could explain just
    >what you are doing and why you are doing all of the CopyMemory calls and

    why
    >you chose all of the values for mbytData, that would help out a lot. Also,
    >since TimerProc is Public, any client can call this method, which is
    >problematic at best. I realize that if you are walking the vtable, you
    >really didn't have a choice in this case, but this leads to programming

    by
    >convention (i.e. the client has to know not to call this method).
    >
    >Also, have you tested this out with any other APIs that require a callback?
    >
    >Regards,
    >
    >Jason
    >
    >"Michael Culley" <m_culley@one.net.au> wrote in message
    >news:392d30a5$1@news.devx.com...
    >>
    >> It is available at
    >>
    >> www.VBDotCom.com
    >>
    >> Click on free code. The timer is the last item in the list.
    >>
    >> It is not necessary to use VB4 to test it, it works also in vb5 and 6.
    >>
    >> Michael Culley

    >
    >
    >



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center