Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
V

Vancouver

@Vancouver
About
Posts
113
Topics
41
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Resource view with converted project
    V Vancouver

    1. No, it is not the Express. It is the full professional version. 2. I do not receive any error message. Even more strange: I started a new project in order to test this issue. It is the simple dialog with the default buttons, I have not done anything yet. The dialog editor has been started automatically, and it works as supposed to - however, the resource tab is still empty in the new project as well. I added a bitmap resource; I could edit it, but after having closed it, the recource tab is still empty. Moreover, the class view tab too is empty, both in the converted and in the new project.

    C / C++ / MFC help tutorial question learning

  • Resource view with converted project
    V Vancouver

    1. I created a project with VC6. Now I opened it with VC8, which converted the project. However, the resource tab is empty. The resource file is there, the program is running, but I don't see the resources (and can't edit them). 2. How does one start the dialog editor in VC8? The help is crap; it contains everything about the dialog editor but not how to start it. Thanks

    C / C++ / MFC help tutorial question learning

  • Directories of the current process
    V Vancouver

    Thanks, it was very quick.

    C / C++ / MFC question

  • Directories of the current process
    V Vancouver

    How can I get the paths of the directories from which the application has been loaded, and the "current" directory (the one, which is specified in the "Start in" of the properties)?

    C / C++ / MFC question

  • Mouse event pecularity in vertical scrollbar
    V Vancouver

    The scrollbars are children of the dialog.

    C / C++ / MFC help question

  • Mouse event pecularity in vertical scrollbar
    V Vancouver

    The scroll bars are separate controls. I'm sorry, I did not mention this, because I thought the fact that the mouse movement over the horizontal scroll bar will be reported makes this clear.

    C / C++ / MFC help question

  • Mouse event pecularity in vertical scrollbar
    V Vancouver

    I have a static control with horizontal and vertical scrollbars. Both scrollbars are enabled and effective (i.e. there is scrolling amount), working fine. The static control is a subclass of CStatic. I am monitoring the mouse actions in this static control with OnLButtonUp, OnLButtonDown, OnRButtonUp, OnRbuttonDown and OnMouseMove. Additionally, there is an OnMouseMove in the parent window of the static control (which is the dialog). This monitors if the mouse leaves the rectangle of the static control. Everything works fine, EXCEPT when the mouse moves from the static control over the vertical scroll bar rectangle, this will not be reported to the parent's OnMouseMove However, there is no problem with the horizontal scroll bar, and if the vertical scrollbar is disabled, then the mouse move will be reported. What can be the reason to this behaviour?

    C / C++ / MFC help question

  • Accessing the parent's data members
    V Vancouver

    This appeared to be all right, at least syntactically. However, CMyOwnDlg *Parent = dynamic_cast (GetParent()); in the function of the control caused an error: RTDynamicCast threw an exception.

    C / C++ / MFC

  • Accessing the parent's data members
    V Vancouver

    class *Parent; is in CMyOwnCtl.h. If it was not there, I would not have any problem: in the function itself CMyOwnDlg can be used. because both headers are known there (and then John M. Drescher's suggestion works).

    C / C++ / MFC

  • Accessing the parent's data members
    V Vancouver

    Sorry, I mistyped it in the post. Of course I declared it as a pointer and it created the mentioned error.

    C / C++ / MFC

  • Accessing the parent's data members
    V Vancouver

    I tried this already before asking, but it causes an error, when assigning the address of the parent to the pointer. If ctl_MyControl is the member variable of the instance of the subclassed control, and Parent is defined in MyOwnCtl.h as class Parent; then ctl_MyControl.Parent = this; in the parent's OnInitDialog causes error C2440: '=' : cannot convert from 'class CMyOwnDlg *const ' to 'class $S217 *' However, if the pointer is defined (in the globals) as CMyOwnDlg *Parent; then Parent = this; works fine from OnInitDialog.

    C / C++ / MFC

  • Accessing the parent's data members
    V Vancouver

    I subclassed a control (actually, a CStatic) and want to access from it's functions some data members of the parent. Let's say the new class of the control is CMyOwnCtl, and the parent, the main dialog, is CMyOwnDlg. I am defining a pointer to the parent in CMyOwnCtl.h: CMyOwnDlg *Parent; This works only with #include "CMyOwnDlg.h" #include "CMyOwnCtl.h" in this sequence. However, CMyOwnDlg.h requires the definition of CMyOwnCtl, i.e. the includes have to be in the other sequence. I solved this by placing the pointer to the parent in the global definitions. However, I wonder if it could be done more elegantly.

    C / C++ / MFC

  • ON_LBUTTONDOWN
    V Vancouver

    Mark, I have to disappoint you. I am in the middle(?) of a program, many thousands of code lines. I don't intend to go back in time and in code. I had come to the idea, that it would be nice to have a feature controlled with the mouse button hold down. (No, I don't need any suggestions, how to realize that. I only need "my cursor" back.)

    C / C++ / MFC question

  • ON_LBUTTONDOWN
    V Vancouver

    As I posted, it worked yesterday, before I subclassed the control, and it is not working any more. I can't claim, that the subclassing is to blame, as it is not working in the main window either. The questions indicate, that there is no point to discuss this subject here and now. I have to work backwards and see, at which point the problem appears respectively disappears.

    C / C++ / MFC question

  • ON_LBUTTONDOWN
    V Vancouver

    It was not MUCH trouble, for sure, but it increases the amount of code, it requires two new source files, it requires duplicating some handlers. I am not lazy to do that, but I like compact code, the smaller the better. Plus, my SetCursor is not working any more, not only in the new handlers, but not even in the main window, and I don't see the connection.

    C / C++ / MFC question

  • ON_LBUTTONDOWN
    V Vancouver

    That's what I too believed, however, that is not so. I had an ON_BN_CLICKED handler for this control, which worked, but as it turned out, SS_NOTIFY does not cause the xBUTTONxxx events pass to the parent.

    C / C++ / MFC question

  • ON_LBUTTONDOWN
    V Vancouver

    I was afraid of this answer, I thought I can somehow avoid the trouble. Anyway, thanks.

    C / C++ / MFC question

  • ON_LBUTTONDOWN
    V Vancouver

    Hi, I have defined handlers for WM_LBUTTONDOWN and WM_LBUTTONUP. The routines do receive control when pressing/releasing the button, EXCEPT if the mouse is over a static control - and I want to gain control exactly in that situation. In fact, the handlers don't receive the control if the mouse is over any control on the main window, only if the mouse is over an area of the main window, where there is no control. I can process the CLICKED event for that control, but that's not what I need. This particular control does not have any message handler. The documentation states If the mouse is not captured, the message is posted to the window beneath the cursor but ON_WM_LBUTTONDOWN and LBUTTONUP don't accept a specification of the control. How can I catch this event related to a specific control?

    C / C++ / MFC question

  • Handling of ESCAPE and RETURN
    V Vancouver

    Thanks, it works with KEYDOWN

    C / C++ / MFC question

  • Handling of ESCAPE and RETURN
    V Vancouver

    I want to handle the ESCAPE key in certain situation; I try to catch it in PreTranslateMessage with WM_KEYUP. Pressing ESCAPE leads always to the "cancel" result. If I have a control named IDCANCEL, the OnClicked handler receives the control, whenever ESACPE has been pressed, but I can not differentiate between clicking on that control and the "true ESCAPE". Is there a way I can separate the "escape" key from the CANCEL button and from "exit" ("X" in the system menu)? Actually, I need it in a CEdit control.

    C / C++ / MFC question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups