Advertisement

Simple Q about DialogBox(...)

Started by May 25, 2001 02:06 AM
2 comments, last by ed9er 23 years, 8 months ago
when we need to display a dialog box, we could use this API: DialogBox (hInst, "MYDLGBOX", hwnd, MyDlgBoxProc); here i know the MyDlgBoxProc is distinct from WndProc, read on... windows must has some kind of pre-defined wndclass for dialog box (say DefDlgClass), thus it''s must somewhere a DefDlgProc(), and i can image how it likes: if ((*UserDlgProc)(...)) return; switch (message) { ... } here our MyDlgBoxProc is known as UserDlgProc all of the above is make sense. my question is: how does DefDlgProc() know the callback entry: UserDlgProc? as i can understand, DefDlgProc is registered with DefDlgClass sometime the OS set itself up, and then there''s a CreateWindow(...) call in DialogBox(), there''s no way to tell DefDlgProc: "for this window, the UserDlgProc is MyDlgBoxProc..." ok, please gimme some comments if you think i get something wrong, or you just know how it works thanks in advanced!
------------------------------------------------------CCP is fascistic, they even banned www.sourceforge.net
Function pointers..
Advertisement
yes i know it''s function pointer, look at what i post before:

((*UserDlgProc)(...))

i am asking: how DefDlgProc get this fuction pointer(which i give it as a argument when i call DialogBox(..))?
------------------------------------------------------CCP is fascistic, they even banned www.sourceforge.net
A function name minus the () is the address.
foo() <- function
foo <- address

????????

This topic is closed to new replies.

Advertisement