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
G

gokings

@gokings
About
Posts
35
Topics
14
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Multiple dynamically created Spin Button Controls
    G gokings

    Thank you for your feedback. The range macros of which I was aware were: ON_COMMAND_RANGE, and ON_CONTROL_RANGE, neither of which matched the function prototype I normally use for a spin button control. The ON_NOTIFY_RANGE worked great. However, I did have to add an ID parameter to the message handling function. [The first parameter, in case anyone is interested.] Due to the additional parameter, one need not use the mentioned structure members to identify the control.

    C / C++ / MFC help tutorial question csharp c++

  • Multiple dynamically created Spin Button Controls
    G gokings

    Hello, ENVIRONMENT: MFC I seek help regarding the dynamic creation and use of Spin Button Controls. Every example/tutorial I've found provides a lot of information, all of which I already know. They all state the obvious, and avoid addressing the only non-obvious (at least to me) aspect. When dealing with a statically created (or a single dynamically created) control, "up" and "down" messages are generally handled by a method of the spin button's parent window, having a prototype such as:

    void Dlg::OnDeltaposSpinFoo(NMHDR* pNMHDR, LRESULT* pResult)
    {
    }

    The NMHDR* parm can be type cast to an NMUPDOWN*, which provides data specific to a Spin Button Control. The message map for the parent window contains an entry such as:

    ON\_NOTIFY(UDN\_DELTAPOS, IDC\_SPIN\_ADJUST\_FOO, OnDeltaposSpinFoo)
    

    In such a case, it's obvious which spin control has been clicked, since the method is invoked for only a single control. Suppose I want a range of ID's to be associated with OnDeltaposSpinFoo()? Say I dynamically create a number of spin controls on a window, for which I wish to use a single message handler. For some controls, such as buttons, there are "range" macros that may be placed in the message map. How about for a spin button control? If I could manage to have OnDeltaposSpinFoo() called for a range of ID's, I could identify the control by the idFrom member of the NMHDR parm (see structures below). I'd probably subtract a base value from the idFrom value to obtain an index to be used programmatically). [

    The relevant structures are:

    typedef struct tagNMHDR {
    HWND hwndFrom;
    UINT_PTR idFrom;
    UINT code;
    } NMHDR;

    typedef struct _NM_UPDOWN {
    NMHDR hdr;
    int iPos;
    int iDelta;
    } NMUPDOWN, *LPNMUPDOWN;

    ] The bottom-line questions are: 1) How can I place an entry in the message map that will cause a "spin button prototype" function to be called (with an NMUPDOWN*) for a range of control ID's? 2) If that's not possible, how else can I handle the problem? I'd appreciate suggestions. Even more, I'd appreciate a working example project that will build and run using Visual Studio 2008 (I don't expect anyone to spend a lot of time creating one, but if you have one, or can quickly create one from something you have....).

    C / C++ / MFC help tutorial question csharp c++

  • [Message Deleted]
    G gokings

    [Message Deleted]

    C / C++ / MFC

  • ON_WM_MOUSEMOVE in CFrameWnd
    G gokings

    Hello, I have an MFC dialog application (VC++ 6 environment). I've used the class wizard to create a handler for mouse movement in my main frame window (to intercept ON_WM_MOUSEMOVE messages). However, the handler is never invoked. I can create a handler in the View (rather than main frame) and it is invoked. However, I want to capture all mouse movement, including mousing over the application's main menu area (outside of the view window). Any help appreciated.

    C / C++ / MFC c++ help workspace

  • CListBox::CompareItem()
    G gokings

    Does anyone happen to have a complete buildable project using ClistBox::CompareItem()? If I set the list box to "has strings", CompareItem() is never called. If I uncheck "has strings", then CompareItem() is called, but all the information in the COMPAREITEMSTRUCT regarding item 2 appears to be garbage. Thanks

    C / C++ / MFC question

  • Get Hard Drive Serial Number in VC++
    G gokings

    I will check into it. Thank you very much.

    C / C++ / MFC c++ tutorial question

  • Get Hard Drive Serial Number in VC++
    G gokings

    Thank you, but this retrieves a so called "serial number" assigned to a logical drive when the drive is formatted. I am interested in the manufacturer's serial number, the REAL serial number of the drive. Thanks for replying.

    C / C++ / MFC c++ tutorial question

  • Get Hard Drive Serial Number in VC++
    G gokings

    Can anyone tell me how to obtain the actual hard drive serial number from a VC++ application? Thanks

    C / C++ / MFC c++ tutorial question

  • Menu item changed event
    G gokings

    I was able to accomplish my goal by handling WM_MENUSELECT; Thanks

    C / C++ / MFC

  • Menu item changed event
    G gokings

    I am using TrackPopupMenu() to display a popup menu and allow a user to make a selection. I would like to have an event occur (have a method called) each time the selected item in the menu changes. In other words, as the user moves the mouse up and down the menu, as a menu item becomes selected (not clicked, simply highlighted), I would like an opportunity to take an action (such as display information regarding what will occur if the user selects that menu option). Thanks

    C / C++ / MFC

  • NTFS extended file attributes in C++
    G gokings

    Thanks for the info! I have found that NTFS does not support extended attributes in the sense that OS/2 does (unfortunately, in my opinion). However, it does support multiple data streams. Normally, the default (unnamed) data stream is accessed. I can use a named data stream to achieve my purpose, though I have to jump through a few hoops. Thanks for the feedback!

    C / C++ / MFC question c++ workspace

  • NTFS extended file attributes in C++
    G gokings

    I wish to read and write NTFS extended file attributes in C++. I was very surprised that I did not find this information readily available. First I am assuming that NTFS extended file attributes are name-value pairs of strings. Is this correct? May I create a name and a value and attach that to a file as an extended file attribute? Presuming that that is correct, how do I 1) Determine whether a file supports extended file attributes (resides on a NTFS drive) 2) Read the extended file attributes 3) Set the extended file attributes I am in a VC++ 6 environment. Thanks

    C / C++ / MFC question c++ workspace

  • Pre-Allocating stl maps / multimaps
    G gokings

    Well, I was unaware of the following article when I replied earlier. You may be well aware of it. It applies to maps, but I don't know whether multimaps are supported, I have not spent the time to check. For what it is worth: http://www.codeproject.com/vcpp/stl/PGIL.asp

    ATL / WTL / STL c++ question

  • Non-uniform width button in toolbar
    G gokings

    Thanks for the information and your offer to zip and send me the code. I will look into the Q article, as well as another possibility. If I think the zipped code would be useful, I'll send you an email. Thanks again for the offer.

    C / C++ / MFC tutorial question

  • Tooltips stopped working
    G gokings

    That is some good thinking. I should have posted that I "solved" this problem. First of all, it turned out that tooltips did appear every once in a while, maybe once out of 50 times that the cursor was moved over the button. In an effort to solve the problem, I started getting earlier versions of my source code out of Source Safe, and each time, the tool tips worked. Finally, I got to where there was a trivial difference between the "current" source and the source that did not work, a difference that could not matter, it seemed to me. Let me mention here that I did "rebuild all"s on the "current" version, which did not help. Finally, I checked out the current version of the code to a fresh directory. In other words, I checked out code identical to the source code which exhibited the problem. When I built the project, tool tips worked! I will say that I do not check in .dsw, .clw, or any of the "project" files, other than .dsp (well, .rc and resource.h are checked in, of course). I simply do not know. It seems so odd to me. I never did try deleting all the files from the "debug" or "release" folders, rather than just doing a rebuild all. Perhaps it was evil electrons.

    C / C++ / MFC question

  • conflict between ATL and MFC
    G gokings

    I was once asked to look at why a process was taking a long time to accomplish a task. One thing the process did was load a large number of entries into a CMap. I did a bit of experimentation, and found that inserting 300,000 entries into a CMap took a bit over 4 hours. Doing 300,000 lookups on the CMap also took a bit over 4 hours. I tried an STL map, and found that inserting 300,000 entries took 22 seconds, and looking up 300,000 entries took 19 seconds. I've never had any use for CMaps. If you can, you might try switching to an STL map.

    ATL / WTL / STL c++ help

  • Pre-Allocating stl maps / multimaps
    G gokings

    Do you mean to allocate it at compile time? Or do you mean that you know how many entries you will add, and you want to reserve the memory ahead of time? If the former, I don't believe it can be done. If the latter, I would suggest making the values pointers, e.g., map. You could potentially preallocate the memory for CFoos (simple if it is just a struct, otherwise more work). The memory for the nodes would not be preallocated, but the nodes would be fairly small.

    ATL / WTL / STL c++ question

  • Obtaining screen dimensions
    G gokings

    Awesome, thanks!

    C / C++ / MFC c++ tutorial question

  • Obtaining screen dimensions
    G gokings

    Awesome, thanks!

    C / C++ / MFC c++ tutorial question

  • Non-uniform width button in toolbar
    G gokings

    Does anyone know how to have a button on a toolbar which is of a different width than the other buttons? I have tried using multiple toolbars, and that works, but does not give the result I want when the window is made resized small and then back large again. Thanks

    C / C++ / MFC tutorial 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