How to register class member function as lpfnWndProc? Cannot convert delegate to function

Jesse Phillips Jessekphillips+D at gmail.com
Fri Sep 28 12:07:20 PDT 2012


On Friday, 28 September 2012 at 17:53:59 UTC, deed wrote:

> (Defining wndProc as a global function works, but is not what I 
> want to do...)
> What is the issue here and how do I make it work?

You are interfacing with C, which does not support functions with 
state (delegate). You must pass it a function, and while you can 
get at the function pointer of a delegate this is unsafe.

You make it work by providing a function and not a delegate. I do 
not know how to wrap a delegate to make that work.


More information about the Digitalmars-d-learn mailing list