CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 1999
    Posts
    5

    discrepancy in MSDN...

    There seems to be some discrepancy in VC++ 6, or I am confused. In previous posts I was told how to use the setfocus() function. It said to pass the ID of the window as a parameter. Seemed logical so I did this but I got an error message saying that Setfocus does not take 1 parameters (don't you just love error messages?). I then checked MSDN. Looking at 'window focus' in general I find set focus takes a parameter, a HWND, as do SetActiveWindow and SetCapture. I then check the SetFocus function itself and it says it takes no parameters. SetCapture and SetActiveWindow in their respective help topics also say that they take no parameters. When actually typing code the autocomplete finishes off the function, saying that it takes no parameters. This makes no sense so could someone please explain what is going on here.

    I also have included an activeX control in my program (SDI app). I want to know when the user clicks on the app and changes some variables, however the WM_LBUTTONDOWN only fires when I don't click on the control. Does anyone know how I could be notified when the user clicks on the control.

    Thanks

    Mark


  2. #2
    Join Date
    Apr 1999
    Location
    Germany
    Posts
    418

    Re: discrepancy in MSDN...

    Hi Mark,

    the reason for the different number of parameters is the MFC. There is a SetFocus function of the system, which takes a HWND as parameter, and there is a SetFocus member function of CWnd, which doesn't take a parameter. The reason for this is that the MFC maps it to the system function the the member variable m_hWnd of the class CWnd as parameter.

    Sorry, but I can't help you with your second question. I have too less experience with ActiveX controls, but I think, if the control doesn't notifies the owner window, you have no chance.


    Martin

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured