Hello,
I'm working on this GUI ... (Screenie):
http://forum.thegamecreators.com/xt/xt_apollo_pic.php?i=1479986
...that's part of my DarkGDK OOP library...
Thread:
http://forum.thegamecreators.com/?m=forum_view&t=124748&b=22
Download:
http://code.google.com/p/darkgdkoop/
...and well...
I'm at the point where I need to Pass a FUNCTION'S POINTER (The address to a message handler) to the Window Class Constructor. Like Windows, Like I've done in FreePascal. I can't seem to get the Syntax Right.
Would you believe I figured this out while posting this message! ... I'll Go On so next person can do this.
I can DECLARE a POINTER to a FUNCTION:
typedef void(*TMSGHANDLER)(JGC_GUIMESSAGE *p_Msg);
This is basically a "TYPE" that just happens to describe a function.
I now have a member of my window class....
class JGC_GUIWINDOW:public JGC_GUIWIDGET{
public:
TMSGHANDLER *MsgHandler;
...
};
Add the Constructor...
class JGC_GUIWINDOW:public JGC_GUIWIDGET{
public:
JGC_GUIWINDOW(JGC_GUIWIDGET *p_Owner, TMSGHANDLER p_MsgHandler);
TMSGHANDLER *MsgHandler;
...
};
And now - when I instantiate this class - I can pass a ZERO (and I have code elsewhere that checks for ZERO before calling this message handler function) OR I pass a custom message handler for my new window. Now I can move forward
Thanx.... um... Well... If you guys weren't here - I wouldn't of tried posting - which is how I figured it out... Ah well... Code Symantics you know?