Results 1 to 7 of 7

Thread: How do one call a function by address?

  1. #1

    Thread Starter
    Lively Member
    Join Date
    May 2000
    Location
    Norway
    Posts
    112
    How do one call a function by address?

  2. #2
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    in what way? if you have vb5 or higher, then you can use the AddressOf operator, which gets the address of a function, in case you need to supply a function pointer to an API function...but I don't know what you need.

  3. #3

    Thread Starter
    Lively Member
    Join Date
    May 2000
    Location
    Norway
    Posts
    112
    I want to be able to call a function by its address.
    Something like this:
    Call AdressOf(MyFunction), Parameters.

  4. #4
    Addicted Member
    Join Date
    May 2000
    Location
    Grand Rapids, MI
    Posts
    231
    Visual basic can pass any of its objects by reference, but visual basic still cannot use callback functions, it is not capable of using function pointers.
    -Karl Blessing aka kb244{fastHACK}
    [email protected]

  5. #5
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    you can't do it as Call AddressOf(func), params

    why not func(params)?

    AddressOf is for passing to API functions such as CreateDialogBox(...), which requires a pointer to a function which handles the messages for the window. if you have no idea what i'm going on about, have a look at http://msdn.microsoft.com/library , and look at the example programs for windows in C++ - then you'll understand. (in that case you're 1-up on me, 'cuz I don't).

  6. #6
    Addicted Member
    Join Date
    May 2000
    Location
    Grand Rapids, MI
    Posts
    231

    Talking

    Typically the way a person would be able to use a callback function in visual basic is with the aid of APIs to perform the execution of the location for you, I seen it online somewhere, I'll post it here if i find it, but I know it could have been on the Vb-world.net articles or Tips.
    -Karl Blessing aka kb244{fastHACK}
    [email protected]

  7. #7
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    use it for subclassing. (ooh look - within 10 mins!)

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