Results 1 to 4 of 4

Thread: Callbacks? slightly confused.....

  1. #1

    Thread Starter
    Fanatic Member crispin's Avatar
    Join Date
    Aug 2000
    Location
    2 clicks west of a Quirkafleeg...Cornwall, England
    Posts
    754
    guys, consider the following:

    Code:
    Public Type editstream
        dwCookie As Long
        dwError As Long
        pfnCallback As Long
    End Type
    the pfnCallback has to be the address of an application defined callback function, how do I go about pushing this in, this is how far I got....

    Code:
    Dim iResult&
    eStream.dwCookie = 9
    eStream.dwError = 0&
    eStream.pfnCallback  = AddressOf EditStreamCallback
    I know this is incorrect - I just need some pointers here (scuse the pun )
    Crispin
    VB6 ENT SP5
    VB.NET
    W2K ADV SVR SP3
    WWW.BLOCKSOFT.CO.UK

    [Microsoft Basic: 1976-2001, RIP]

  2. #2
    Hyperactive Member
    Join Date
    Jan 2000
    Posts
    355
    yeah, addressof only is valid as a parameter to a function unfortunately
    so you can't put Addressof Myfunc directly into the type
    but there's a simple workaround:

    Function ReturnAddress(Byval FuncPtr as long) as long

    ReturnAddress = FuncPtr

    End function

    so:

    Dim iResult&
    eStream.dwCookie = 9
    eStream.dwError = 0&
    eStream.pfnCallback = ReturnAddress(AddressOf EditStreamCallback)
    buzzwords are the language of fools

  3. #3
    coder. Lord Orwell's Avatar
    Join Date
    Feb 2001
    Location
    Elberfeld, IN
    Posts
    7,628
    if you get this to work, can you email me? Im currently trying to get the em_streamout and em_streamin messages to work also. They both use that type declaration.
    My light show youtube page (it's made the news) www.youtube.com/@lightsofelberfeld
    Contact me on the socials www.facebook.com/lordorwell

  4. #4

    Thread Starter
    Fanatic Member crispin's Avatar
    Join Date
    Aug 2000
    Location
    2 clicks west of a Quirkafleeg...Cornwall, England
    Posts
    754
    Lord Orwell

    Thats why I put the post out, If I get it working i'll post a new thread for ya!
    Crispin
    VB6 ENT SP5
    VB.NET
    W2K ADV SVR SP3
    WWW.BLOCKSOFT.CO.UK

    [Microsoft Basic: 1976-2001, RIP]

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