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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
S

Simon Langdon

@Simon Langdon
About
Posts
11
Topics
5
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Can someone (briefly) explain ON_UPDATE_COMMAND_UI?
    S Simon Langdon

    Yes, to be clear I can't see why _I_ would want to handle this message. But does MFC manage this message handler for every window in my app with a Message Map? I'm trying to decide if there's anything in my code base responsible for calling this unnecessarily.

    C / C++ / MFC design question

  • Using array of string values
    S Simon Langdon

    It sounds like a trivial issue, use whichever types you're comfortable with. STL vectors and CStringArrays both leap to mind; do you need to save this data somehow? CStringArrays support CArchive but you may want to think about encryption or some other safety feature.

    C / C++ / MFC c++ question data-structures help

  • Can someone (briefly) explain ON_UPDATE_COMMAND_UI?
    S Simon Langdon

    My legacy app. uses this message handler to do button enabling / disabling. However it gets called very frequently (eg on mouse move). is there any way of filtering / controlling the messages that cause this function to get called? I can't see why I'd want to do anything with my toolbars & icons in response to UI messages anyway. Thanks

    C / C++ / MFC design question

  • Stuck with function pointers in C and C++
    S Simon Langdon

    Thanks for the reply - my original question was based on the premise that my casting or function declaration was wrong in some way - actually it looks like getting a pointer to a non-static class function and then casting it to match the original 'C' functions isn't straightforward. So solution 1 - make the function and all the class variables static. solution 2 - examine the original 'C' function that takes the function pointer and re-implement it. Thanks for looking. :)

    C / C++ / MFC help c++

  • Stuck with function pointers in C and C++
    S Simon Langdon

    Cheers.. I'm having a play with this but you've modified globFunction, which in my case I'm really trying to avoid. Also it wont build as it stands (you can't call non static functions from a static function).

    error C2352: 'theClass::theFunction' : illegal call of non-static member function

    C / C++ / MFC help c++

  • Stuck with function pointers in C and C++
    S Simon Langdon

    Yes, good answer. Thanks for that. :)

    C / C++ / MFC help c++

  • Stuck with function pointers in C and C++
    S Simon Langdon

    I'm trying to copy some C code to a C++ class and I've got stuck with a function pointer issue. I've been trying to mess around with calling conventions but I don't want to make my C++ function static and don't want to change the old C code. Thanks for looking.

    class theClass
    {
    public:
    int theFunction(int theParam1);
    int anotherFunction(void);
    };

    typedef int (*funcPtr) (int Param1);

    int theClass::theFunction(int theParam1)
    {
    return 0;
    }

    int function(int theParam1)
    {
    return 0;
    }

    bool globFunction (funcPtr aFunction, bool someOtherArg)
    {
    int anArg = 0;
    int ret = aFunction(anArg);
    return true;
    }

    int theClass::anotherFunction(void)
    {
    globFunction (function, false);

    globFunction (&theClass::theFunction, true); //  error C2440: 'type cast' : cannot convert from 'int (\_\_thiscall theClass::\* )(int)' to 'funcPtr'
    
    return 0;
    

    }

    C / C++ / MFC help c++

  • CMFCPropertyGridProperty - Protected methods don't get called
    S Simon Langdon

    Who's got experience with this class then? Examples and documentation seem pitifully thin on the ground. I'm just playing with it to see if it's the right control for a new development. At the moment I'm wondering how to add a button to a property. The doc suggests overloading the protected "HasButton" function "Indicates whether a property contains a button." says MSDN So I don't know if I'll get a button by overloading this and returning TRUE because my overloaded function never gets called; other protectesd functions that don;t ever seem to be called are Init, CreateCombo or IsValueChanged maybe I'm contructing my CMFCPropertyGridProperty wrong? Thanks for looking.

    C / C++ / MFC tutorial question

  • Multiprocessor sort and search in C?
    S Simon Langdon

    Is there a multiprocessor implementation of qsort and bsearch out there? My app. is mostly in C but some bits have got C++ and STL depending on what libraries are needed. We compile with VS2008 so openMP is available.

    C / C++ / MFC c++ question

  • How to capture a SetLastError (VS2008) / debug?
    S Simon Langdon

    Thanks for the responses. I managed to find a breakpoint for some function that releases memory. Need to brush up on my assembly perhaps? :-D Not quite what I asked, however a chap at work suggested typing $err into the watch window, this dispays the current value of GetLastError so I can step through code seeing where it changes.

    C / C++ / MFC visual-studio debugging tutorial question

  • How to capture a SetLastError (VS2008) / debug?
    S Simon Langdon

    Something in my app. (C/Win32)is setting SetLastError and I want to debug it, eg capture all calls in my process to this function. Any idea how I'd configure VS to break here? Thanks

    C / C++ / MFC visual-studio debugging 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