#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2002
    Posts
    1
    Rep Power
    0

    MFC Custom Draw Help please


    Hi all,

    I have been stuck on a problem for some time and would REALLY appreciate any help I can get with it. Currently I have a list control that displays information as shown below.

    Entity Name Amount Success Failure Unknown
    IfcAxis2Placement3D 11 11 1 0
    IfcCartesianPoint 29 29 0 0
    IfcDirection 26 26 ´ 1 0

    As you can see from the list (this list usually contains about 30 entrys) both IfcAxis2Placement3D and IfcDirection have failures, what I want to do is make theses entrys with failures blue, now the index of these items is known, ie. I have a vector that stores the entrys with errors, so for this list I would have a vector simply containing 0 and 3, currently I am using this code to change these entrys to blue, but it simply does not work:

    for(int k = 0; k < kMax ; k++)
    {

    colorPoint = Org[k] ;
    if (pLVCD->nmcd.dwItemSpec == colorPoint)
    {
    crText = RGB(128,128,255);
    }
    else
    crText = RGB(0,0,0);
    }

    Here, Org is the list of indexs that I explained above and as you can see I am looping through them and then changing that index value to blue, the only problem is it only ever changes the last value to blue, i.e. in the above example it changes IfcDirection to blue but ignores IfcAxis2Placement3D !! I think it is obvious I am not using the right method to change on a specific index, but cannot find another that works. Any help greatly appreciated…..

    Thanks again,

    Tristan
  2. #2
  3. No Profile Picture
    Offensive Member
    Devshed Novice (500 - 999 posts)

    Join Date
    Oct 2002
    Location
    in the perfect world
    Posts
    622
    Rep Power
    27
    I do not use much MFC (takes away too much of my control and makes my apps too bloated).

    Do a lot of owner draw in WIN32 API with Listviews.

    Using WM_DRAWITEM msg's. But this is for complex LV's not the simpler custom draw.

    Let me know if you this can help.
    The essence of Christianity is told us in the Garden of Eden history. The fruit that was forbidden was on the Tree of Knowledge. The subtext is, All the suffering you have is because you wanted to find out what was going on. You could be in the Garden of Eden if you had just kept your f***ing mouth shut and hadn't asked any questions.

    Frank Zappa

IMN logo majestic logo threadwatch logo seochat tools logo