For Programmers: Free Programming Magazines  


Home > Archive > Visual Basic Syntax > January 2006 > Execute Callback function within VB6?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Execute Callback function within VB6?
Jason Barnett

2006-01-09, 10:46 pm

Is there a way to execute a callback function in VB6?

I'd like to pass the address of a function into a VB6 procedure and have the
VB6 procedure execute the function appropriately. Is this possible?


Ken Halter

2006-01-09, 10:46 pm

"Jason Barnett" <jwb@wbai.com> wrote in message
news:OoIE8ZkEGHA.272@TK2MSFTNGP10.phx.gbl...
> Is there a way to execute a callback function in VB6?
>
> I'd like to pass the address of a function into a VB6 procedure and have
> the VB6 procedure execute the function appropriately. Is this possible?


If this is entirely VB6, have you tried CallByName? I haven't done anything
"real" with it but it's there.

There's also a few samples that show how to call function pointers. I'm not
sure if this is what you're after.

Call Functions Pointers
http://www.planetsourcecode.com/vb/...=32873&lngWId=1

....and then, there's always the AddressOf method but I don't see how that
would help.

--
Ken Halter - MS-MVP-VB - Please keep all discussions in the groups..
DLL Hell problems? Try ComGuard - http://www.vbsight.com/ComGuard.htm
Freeware 4 color Gradient Frame? http://www.vbsight.com/GradFrameCTL.htm


Jason Barnett

2006-01-09, 10:46 pm

Great, thanks! That might work.


"Ken Halter" <Ken_Halter@Use_Sparingly_Hotmail.com> wrote in message
news:eltiRhkEGHA.3920@tk2msftngp13.phx.gbl...
> "Jason Barnett" <jwb@wbai.com> wrote in message
> news:OoIE8ZkEGHA.272@TK2MSFTNGP10.phx.gbl...
>
> If this is entirely VB6, have you tried CallByName? I haven't done
> anything "real" with it but it's there.
>
> There's also a few samples that show how to call function pointers. I'm
> not sure if this is what you're after.
>
> Call Functions Pointers
> http://www.planetsourcecode.com/vb/...=32873&lngWId=1
>
> ...and then, there's always the AddressOf method but I don't see how that
> would help.
>
> --
> Ken Halter - MS-MVP-VB - Please keep all discussions in the groups..
> DLL Hell problems? Try ComGuard - http://www.vbsight.com/ComGuard.htm
> Freeware 4 color Gradient Frame? http://www.vbsight.com/GradFrameCTL.htm
>



Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com