Help with Callback addresses needed 
Author Message
 Help with Callback addresses needed

Hi,

Can anyone help with the differences using functions with ADDRESSOF (e.g.
vb5) and CALLBACK functions in PBDLL60 ?

Lets say I have (as a simple example) an app that finds window titles using
the 'EnumWindows' function in 'User32'. In the VB app, I can use the
following:-

  EnumWindows (ADDRESSOF MyProc, 0)

where 'MyProc' is a function in the following format

  Public Function MyProc(ByVal app_hwnd As Long, ByVal lParam As Long) As
Boolean
  etc..

How do I pass a CALLBACK function address from PBDLL, and is it likely to
work in the same way ? - I know this is probably a silly question, but I'm
still having trouble getting my head round some of this callback stuff..

Any help greatly received
Regards,
Alan. - (Confused, Devon.)



Fri, 29 Mar 2002 03:00:00 GMT  
 Help with Callback addresses needed
Alan,

In PB/DLL (and PB/CC) ou use CODEPTR() to obtain the address of a
label, sub or function.   Note that you can only obtain the CODEPTR()
for a *label* that is within the same scope.  See the on-line help for
a better description.

Quote:

>Can anyone help with the differences using functions with ADDRESSOF (e.g.
>vb5) and CALLBACK functions in PBDLL60 ?
>Lets say I have (as a simple example) an app that finds window titles using
>the 'EnumWindows' function in 'User32'. In the VB app, I can use the
>following:-
>  EnumWindows (ADDRESSOF MyProc, 0)
>where 'MyProc' is a function in the following format

>How do I pass a CALLBACK function address from PBDLL, and is it likely to
>work in the same way ? - I know this is probably a silly question, but I'm
>still having trouble getting my head round some of this callback stuff..

Lance
powerbasic Support

-------------------------------------------------------------------------
PowerBASIC, Inc.      | 800-780-7707 Sales | "We put the Power in Basic!"
316 Mid Valley Center | 831-659-8000 Voice | http://www.powerbasic.com



Fri, 29 Mar 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Need help to grok c extension that needs to use callbacks with data

2. I need help with callbacks in Visual Eiffel

3. Need help invoking callback from C

4. using <subprogram>'address for callback

5. need help getting segment address in TSR

6. need help with linear addresses

7. Help needed: address of procedure entry

8. JSAI needs callback!

9. ***HELP***HELP***NEED INFORMATION***HELP***HELP

10. Help Prototyping a Callback Function

11. Callback function help.

12. CW OCX eventhandler callback - please help!

 

 
Powered by phpBB® Forum Software