Click here to Skip to main content
15,921,203 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: NSA standard Pin
Maximilien3-May-06 2:56
Maximilien3-May-06 2:56 
Questionsaving contents of url to file Pin
fanomezana2-May-06 22:31
fanomezana2-May-06 22:31 
AnswerRe: saving contents of url to file Pin
Michael Dunn2-May-06 22:50
sitebuilderMichael Dunn2-May-06 22:50 
GeneralRe: saving contents of url to file Pin
fanomezana4-May-06 0:45
fanomezana4-May-06 0:45 
AnswerRe: saving contents of url to file Pin
Hamid_RT3-May-06 0:24
Hamid_RT3-May-06 0:24 
QuestionWrapping the Win32 User Inteface in OO Pin
User 28107302-May-06 22:30
User 28107302-May-06 22:30 
AnswerRe: Wrapping the Win32 User Inteface in OO Pin
Nibu babu thomas2-May-06 23:05
Nibu babu thomas2-May-06 23:05 
GeneralRe: Wrapping the Win32 User Inteface in OO Pin
User 28107302-May-06 23:21
User 28107302-May-06 23:21 
Only have code on home machine Sniff | :^) , but it looks something like this:

class Control {
public:
  virtual bool Create ( Control *parent );

protected:
  virtual bool CreateHandle ( void );
  virtual bool SetParams ( void );
}

bool Control::Create ( Control *parent )
{
  SetParams ();
  CreateHandle ();
}

bool Control::CreateHandle ( void )
{
  handle = CreateWindowEx ( ... )
  SetWindowLong ( handle, GWL_USERDATA, this );
}

bool SetParams ( void )
{
  style = WS_CHILD | WS_VISIBLE;
  classname = "STATIC";
}


This is a stripped down skeleton of it and when I want to create a derived control I do this:

class EditControl : public Control
{
  virtual bool SetParams ( void );
}

bool CEditControl::SetParams ( void )
{
  classname = "EDIT";
}


Boom! Edit control. Same with a buttons, list views, tree views, etc.....

For a actual window control, I derive a CustomControl class which adds some registration methods to register a new window class with WNDPROC etc....

Now here's the problem: I add eg. EditControl as a member in MainWndControl and run the create with MainWndProc as the parent. That window has it's own WNDPROC, and I do a GetWindowLong ( GWL_USERDATA ) inside the wndproc to get a pointer to the actual MainWndControl. Then I add some WM_COMMAND message handling in there to do what the buttons and edit controls is supposed to do. This is fine, but what I want to do is add message handling to specific Control classes to handle things like WM_PAINT, WM_LBUTTONUP, WM_FOCUS and that kind of generic messages.

This is where I tried chaining the WNDPROC's, but the Control receiving the message isn't the Control that has to get processed, because the GWL_USERDATA is set to something else.....
QuestionRe: Wrapping the Win32 User Inteface in OO Pin
Maxwell Chen3-May-06 0:13
Maxwell Chen3-May-06 0:13 
AnswerRe: Wrapping the Win32 User Inteface in OO Pin
User 28107303-May-06 0:31
User 28107303-May-06 0:31 
QuestionCOM Pin
Krishnatv2-May-06 22:24
Krishnatv2-May-06 22:24 
AnswerRe: COM Pin
Nibu babu thomas2-May-06 22:27
Nibu babu thomas2-May-06 22:27 
GeneralRe: COM Pin
Krishnatv2-May-06 23:10
Krishnatv2-May-06 23:10 
GeneralRe: COM Pin
Nibu babu thomas2-May-06 23:14
Nibu babu thomas2-May-06 23:14 
QuestionNeed help on loading bitmaps using bitmap memory without saving it as a file on dialog box Pin
RahulOP2-May-06 22:12
RahulOP2-May-06 22:12 
AnswerRe: Need help on loading bitmaps using bitmap memory without saving it as a file on dialog box Pin
Nibu babu thomas2-May-06 22:14
Nibu babu thomas2-May-06 22:14 
AnswerRe: Need help on loading bitmaps using bitmap memory without saving it as a file on dialog box Pin
Hamid_RT3-May-06 0:25
Hamid_RT3-May-06 0:25 
QuestionButton is not showing . Pin
_AnsHUMAN_ 2-May-06 22:05
_AnsHUMAN_ 2-May-06 22:05 
AnswerRe: Button is not showing . Pin
Nibu babu thomas2-May-06 22:12
Nibu babu thomas2-May-06 22:12 
General[Message Deleted] Pin
_AnsHUMAN_ 2-May-06 22:20
_AnsHUMAN_ 2-May-06 22:20 
GeneralRe: Button is not showing . Pin
Cedric Moonen2-May-06 22:24
Cedric Moonen2-May-06 22:24 
GeneralRe: Button is not showing . Pin
Nibu babu thomas2-May-06 22:24
Nibu babu thomas2-May-06 22:24 
GeneralRe: Button is not showing . Pin
_AnsHUMAN_ 2-May-06 22:29
_AnsHUMAN_ 2-May-06 22:29 
QuestionHow to call a java class from win32 api? Pin
raghuji.rao2-May-06 21:50
raghuji.rao2-May-06 21:50 
AnswerRe: How to call a java class from win32 api? Pin
Ninghuan2-May-06 21:57
Ninghuan2-May-06 21:57 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.