Solved

OWNERDRAWFIXED message in CListCtrl

Posted on 1998-06-08
4
510 Views
Last Modified: 2013-11-20
I'm using LVS_OWNERDRAWFIXED style in CListCtrl Create function. But frame work does not call my DrawItem function. I'm unable to find solution for this. Your help is highle appreciated.
The code I have written is as follows:
BOOL CMyListCtrl::Create()
{
style=WS_CHILD|LVS_REPORT|LVS_SINGLESEL|LVS_OWNERDRAWFIXED | LVS_SORTASCENDING;
BOOL bRet = CListCtrl::Create(style,rect,pParentWnd,nID);
if(bRet)
{

}
..............
return bRet
}

void CMyListCtrl::DrawItem( LPDRAWITEMSTRUCT dis )/*virtual*/
{
................
}
0
Comment
Question by:lganesh
4 Comments
 
LVL 1

Expert Comment

by:Andy_Keys
Comment Utility
You are actually adding somthing to the list aren't you!!??
0
 
LVL 4

Expert Comment

by:piano_boxer
Comment Utility
Take a look at the ROWLIST sample included in Visual C++
0
 

Author Comment

by:lganesh
Comment Utility
Yes. I'm adding at runtime. I verified that Framework is not calling drawitem when I say InsertColumn and SetItemText.
I would like to add some additional information to my question.
In my project, application loads a DLL. Dll creates the list control and adds items at runtime. Do i have to subclass the class derived from list control to get messages.
0
 
LVL 3

Accepted Solution

by:
shaig earned 50 total points
Comment Utility
How about adding to the Create flags the window style reffering to owner drawing?
I don't remmember the exact name, i think it was WS_OWNERDRAW ( it could also be an extended window style ).
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Suggested Solutions

Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
This video discusses moving either the default database or any database to a new volume.

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now