Results 1 to 3 of 3

Thread: Using a TLB to call stuff in windows dlls

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2019
    Posts
    316

    Using a TLB to call stuff in windows dlls

    I call the below function A LOT and was wondering if making a type library from MIDL would gain some performance. As my MIDL is very poor before undertaking the task I am looking for some opinions

    cheers

    Code:
    Private Declare Function GetPerTcpConnectionEStats Lib "iphlpapi" ( _
        ByRef row As Any, _
        ByVal EStatsType As TCP_ESTATS_TYPE, _
        ByRef Rw As Any, _
        ByVal RwVersion As Long, _
        ByVal rwSize As Long, _
        ByRef ros As Any, _
        ByVal RosVersion As Long, _
        ByVal rosSize As Long, _
        ByRef rod As Any, _
        ByVal RodVersion As Long, _
        ByVal rodSize As Long _
        ) As Long

  2. #2
    PowerPoster
    Join Date
    Jul 2010
    Location
    NYC
    Posts
    3,464

    Re: Using a TLB to call stuff in windows dlls

    You'll see some absolute gains since TLB-defined APIs are early bound and declare statements are late bound, but with the speed of computers these days I don't know how much of a difference it would make; probably negligible compared to the time it takes for the function itself to execute and return.

  3. #3
    Fanatic Member
    Join Date
    Jun 2015
    Posts
    748

    Re: Using a TLB to call stuff in windows dlls

    Itís really only the first call to the api that is slower, the address is cached after that and the difference will only be like 5 asm instructions extra per call which is nothing.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width