4 ms·
You kind of can, that is one of their design points, naturally you need to move the context into the body and know what to cast back from. I guess I need to pr
by pjmlp 11mo ago
You kind of can, that is one of their design points, naturally you need to move the context into the body and know what to cast back from.
I guess I need to prove a point on my Github during next week.
- rovingeye 11mo agoI assume by "move the context into the body" you mean using GetWindowLongPtr? Why not just use a static wndproc at that point?
- LegionMammal978 11mo agoIf you mean that you can call a C++ lambda from a static C callback via a context pointer, of course you can do that, it's not very mind-boggling. Rust FFI libraries similarly have to do that trick all the time to turn a closure into a C callback. The primary problem with WNDPROC is how to get that context pointer in the first place, which is the part that OP and everyone in the comments are talking about.
- pjmlp 11mo agoNo need for context pointer, https://github.com/pjmlp/LambdaWndProc/blob/main/LambdaWndProc.cpp#L85 https://github.com/pjmlp/LambdaWndProc/blob/main/LambdaWndPr...