Visual Basic Core Snippet Routines
FARPROC
          
                 
   Returns the Long value passed to the function. Required as a workaround for VB's inability to specify AddressOf against a User-Defined Type argument.          
           Updated:   Monday December 26, 2011   
click to copy code:  


   Applies to:   VB5, VB6   
OS restrictions:   None  
 Code Snippet
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Copyright ©1996-2011 VBnet/Randy Birch, All Rights Reserved.
' Some pages may also contain other copyrights by the author.
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Distribution: You can freely use this code in your own
'               applications, but you may not reproduce 
'               or publish this code on any web site,
'               online service, or distribute as source 
'               on any media without express permission.
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Private Function FARPROC(ByVal pfn As Long) As Long

  'Workaround that receives and 
  'returns the value passed to  
  'enable AddressOf to be used
  'with user-defined type members
   FARPROC = pfn

End Function

 Calling Syntax
   bi.lpfnHook = FARPROC(AddressOf YourCallbackProcedure)

 Comments / Related
demo in use:   SHBrowseForFolder: Pre-selecting Folders using a Browse Callback
Related:     

 
 

PayPal Link
Make payments with PayPal - it's fast, free and secure!

 
 
 
 

Copyright ©1996-2011 VBnet and Randy Birch. All Rights Reserved.
Terms of Use  |  Your Privacy

 

Hit Counter