PDA

Click to See Complete Forum and Search --> : AddressOf operator


Tonatiuh
Jan 17th, 2000, 09:35 PM
How can I implement an AddressOf functionallity into my ActiveX DLL?

Thanks!

mcleran
Jan 17th, 2000, 10:37 PM
AddressOf is used to pass the address of a function to a Win32 DLL. The function must be in a bas module. Check out the examples here on subclassing to see the operator in action.

Tonatiuh
Jan 18th, 2000, 12:13 AM
I know what it is. I want to know HOW to code or implement the functionallity of this operator into my own ActiveX DLL.

mcleran
Jan 18th, 2000, 02:06 AM
There's no one use for the operator. You'll have to be more specific as to what you're trying to do.

Tonatiuh
Jan 18th, 2000, 06:16 AM
The AddressOf operator must bo in the call statment. For example:

Call MyProc(x, AddressOf XProc)

Where MyProc is the procedure into the ActiveX DLL and Xproc is the procedure to execute from within the MyProc.

What do I need to put into the MyProc procedure to perform this funtionality (that call the XProc procedure)? I supouse I need to write some code to MyProc be able to execute the AddressOf functionallity.

Do you underestand? Sorry by my short and bad English.

Thanks!

[This message has been edited by Tonatiuh (edited 01-18-2000).]

mcleran
Jan 18th, 2000, 09:56 PM
You can't use the opertor that way. The only way you can pass addresses of functions is when you pass them from VB to Windows. You can't pass the address of a function to a VB ActiveX DLL.

Crazy D
Jan 18th, 2000, 10:22 PM
Well you can pass the adress of a function to your dll but you can't call it from your dll...
If you want to call an API which wants a callback (subclass), you'll need to do a little more since every instance of your dll will use the function, but basically, add a module to the activex dll, there you need to put it the public function of which you want to pass the adres of to a function.
What are you trying to do?