Results 1 to 2 of 2

Thread: AddressOf method?

  1. #1

    Thread Starter
    Hyperactive Member made_of_asp's Avatar
    Join Date
    Jul 2001
    Location
    123 Fake Street
    Posts
    394

    AddressOf method?

    Hello,

    I never used addressOf before now i came across it... What does it do? Whats it for? Does it do something with that subclassing thingy...

    Thanks a lot for help,
    VS.NET 2003

    Need to email me?

  2. #2
    -= B u g S l a y e r =- peet's Avatar
    Join Date
    Aug 2000
    Posts
    9,629
    MSDN

    Using the AddressOf Keyword
    Any code you write to call a function pointer from Visual Basic must be placed in a standard .BAS module — you can't put the code in a class module or attach it to a form. When you call a declared function using the AddressOf keyword, you should be aware of the following conditions:

    AddressOf can only be used immediately preceding an argument in an argument list; that argument can be the name of a user-defined sub, function, or property.


    The sub, function, or property you call with AddressOf must be in the same project as the related declarations and procedures.


    You can only use AddressOf with user-defined subs, functions, or properties — you cannot use it with external functions declared with the Declare statement, or with functions referenced from type libraries.


    You can pass a function pointer to an argument that is typed As Any or As Long in a declared Sub, Function, or user-defined type definition.
    Note You can create your own call-back function prototypes in DLLs compiled with Visual C++ (or similar tools). To work with AddressOf, your prototype must use the __stdcall calling convention. The default calling convention (_cdecl) will not work with AddressOf.
    maybe that can shed some light on the perpouse of AddressOf...
    -= a peet post =-

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