Can't cast to delgate type from void*?
rmann-d-lang at latencyzero.com
Sun Feb 18 23:01:14 PST 2007
Kirk McDonald Wrote:
> Delegates are 8 bytes. They consist of a function pointer and a context
> pointer. I'm not familiar with Carbon's event handling, but I suspect
> that void* is intended to serve the same purpose as a delegate's context
Yeah, I finally figured this out. I thought the delegate was actually a reference to the 8 bytes, in the same way a class type is a reference. I just needed to take the address of the delegate, and it worked fine. Thanks!
More information about the Digitalmars-d-learn