DrawItem() not called in owner draw listbox

In an owner draw  listbox derived from CListBox, DrawItem() is not called.

It works with VC6, but fails in a VC7 app using the same code.

The listbox control has "owner draw" and "has strings" set.

What more do I have to do to get the framework to call DrawItem() with VC7?

TIA

Jan


0
jan2527 (20)
3/3/2008 11:46:40 PM
vc.mfc 33608 articles. 0 followers. Follow

1 Replies
970 Views

Similar Articles

[PageSpeed] 12

I've done this several times in VS7 without any problem; in fact the listboxes in my
PowerPoint Indexer are definitely owner-draw in VS7.  I've also migrated some VS6 apps to
VS7 with no problem.  You'd need to show something about the message maps and class
declarations to help with this (the actual drawing code in the body is not relevant, but
show the infrastructure, including the class definition, the virtual method declaration,
and if multilevel, all relevant pieces all the way back to the ": public CListBox"
declaration.  BEGIN_MESSAGE_MAP and the IMPLEMENT_DYNCREATE or IMPLEMENT_DYNAMIC
declarations should also be shown.
					joe

On Mon, 3 Mar 2008 23:46:40 -0000, "Jan M" <jan@acu.no-ip.com> wrote:

>In an owner draw  listbox derived from CListBox, DrawItem() is not called.
>
>It works with VC6, but fails in a VC7 app using the same code.
>
>The listbox control has "owner draw" and "has strings" set.
>
>What more do I have to do to get the framework to call DrawItem() with VC7?
>
>TIA
>
>Jan
>
Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
0
newcomer (15975)
3/4/2008 1:12:36 AM
Reply:

Similar Artilces:

Drawing Groups Manufacturing
Does anyone have any experience with Drawing Groups and Drawings in Manufacturing? We have some drawings that we print out with each Working Routing that goes to production and would like to know if I assign the drawings to the routing in Routing Sequence Entry (Other Section, Dawing Group Field) Is there a way to get that to print out when we print a routing? I haven't come across any literature on it. -- Thanks Knavas You would need to use something other than the default GP Report Writer to do this. I know Crystal can but am not sure about SRS -- Richard L. Whaley Author / ...

Create Hidden window for drawing?
Hi all, I am writting a MFC component that will create a hidden window, load a bitmap into the hidden window and then save the hidden window to bitmap file. However, after I loaded the bitmap into the hidden window and save the window into bitmap file using function I found in codeguru (http://www.codeguru.com/cpp/g-m/bitmap/capturing/article.php/c4919/). The bitmap file only contain the desktop window instead of the hidden window. Is it possble to create a hidden window for drawing? Is there any other way I could create a hidden area for the program to draw on and save the area to fi...

SaveBarState fails when it is called from a thread #2
Hi, In my application, I use SaveBarState() for persisting control bar state. The code fragment is something like this. void CMainFrame::OnSavePersistance() { SaveBarState(_T("My Persistence")); // Saves some information to an xml file } Since my xml saving takes some time I changed the code to execute in a thread UINT ThreadFn(LPVOID pParam) { CMainFrame* pThis = (CMainFrame*)pParam; pThis->SaveBarState(_T("My Persistence")); return 0; } void CMainFrame::OnCntrlbartst() { AfxBeginThread( ThreadFn, this ); } But, now in the thread function SaveBarState...

Urgent: Calling an MFC ActiveX dll hosting CHtmlView from C# Class Library
Hi, I have wriiten a MFC ActiveX Control using Visual Studio .Net. By defaut it gave me ocx file as an output. Based on my readings, ActiveX Ocx and Dll are a same thing, so i just changed the file extension to DLL in the project output file option under Project Properties. It generated a dll and registrered it and i am able browse it properly in the Object Browser. I added a reference to it in a C# Class Library Project and it made the wrapper ending with control's name ending with Lib. Problem is when i call an ordinary method of the ActiveX from the C# Libarary, it works fine but when...

listbox #3
I want to make a selection (entire row) from a worksheet en place this row(s) in a listbox. So far I'm able to place the cells from the selected row vertically in the listbox, but I want the row horizontaly (in columns) placed in the listbox. When I use the next formula, I get all the rows horizontally With ListBox1 .ColumnCount = Range("rFactTot").Columns.Count .RowSource = "rFactTot" .ListIndex = 0 .MultiSelect = fmMultiSelectMulti .ListStyle = fmListStyleOption End With But I want to add an if--then statement that o...

Excel VBA 2003: how do I call an Analysis ToolPak function within
Analysis ToolPak is installed in my application and I need to use the result of EOMONTH function in a UDF I am writing. These functions are clearly not amongst the properties/methods of APPLICATION.WORKSHEETFUNCTIONS. I tried this syntax: PrevMthEnd = [atpvbaen.xla]!EOMONTH(Date, -1) but it also does not work. How should it actually be worded? In addition to 'installing' the Analysis ToolPak along with 'Analysis ToolPak - VBA', in the VB Editor, set a Reference (Tools --> References) to atpvbaen.xls It should be in the list of available library refere...

Sort with Listbox Selection On Top
Hi, I have a listbox. When I select an item in the listbox, I would like subform1 to sort column1 with the selection from listbox on top. For example, when I select Pennsylvania from the listbox- it will update subform1 to, while still retaining all of the records, but all records with "Pennsylvania" listed in column1 on top. Is this possible? Thanks shmoussa wrote: >I have a listbox. When I select an item in the listbox, I would like >subform1 to sort column1 with the selection from listbox on top. > >For example, when I select Pennsylvania from the lis...

How do I change settings to call Outlook Contacts with Cisco IP Ph
How do I change settings to call Outlook Contacts '07 with Cisco IP Communicator? ...

Run-time error 5:Invalid procedure call or argument
Run-time error 5:Invalid procedure call or argument I have been running a small app to backup OE for years (same app without updates its) and now all of a sudden I am getting the above error message. Does anyone have any idea what could be causing this message to pop up? Oh, the app is Outlook Express Freeby Backup and Outlook Express Quickie Backup. I feel certain the problem is with the OS its self [X-post to OE General] The author withdrew OE Freebie Backup over 5 years ago. You should only be using OE Quick Backup now. Docster wrote: > Run-time error 5:Inval...

Opportunity Product Call Out
Does anyone know if it is possible to do a post call out on the opportunity product page? The information I have researched so far doesn't mention it being an entity that I can do that with. Second part to this question is that if I can do this how will I get each products value sent to me, is there a way to loop through the values sent to me in the post call out. If you can't tell I am new to this, I am not looking for code or anything as I will figure it out, I just want to know if it can be done before spending time trying to do it if it can't be done. Thanks, Brian ...

OnDraw() not called in derivative of CEditView (MDI documents)
VC++ 6.0; MFC; MDI In the function OnDraw(...) I would like to change the font of the EditView. The overloaded function OnDraw(...) is never called. Only the function OnUpdate(...) is called. So I stepped through the MFC. In WINFRM.CPP the message WM_INITIALUPDATE is sent to all views. Is it possible that during OpenDocumentFile() no _DRAW message is sent? Do I have to send this message? Other solutions? ////////////////////////////////////////////////////////////////// // Dialog: class CTxtDlg : public CEditView { protected: virtual void OnDraw(CDC* pDC); virtual void OnUpdate(CView* p...

Phone call linked to case and contact doesnt show phone number
Hi, Creating phone call activities in v3 linked to cases which are linked to contacts. The phone call activity doesn't pull through the phone number - kind of irritating. Can anyone tell me if this is standard - or perhaps whether the number should appear ? Regards Pete. Does anyone have a solution on this? We would like the same functionality as well and it does not look like you can do a direct mapping from the Phone Call to Contact. "PeteC" wrote: > Hi, > > Creating phone call activities in v3 linked to cases which are linked to > contacts. The phone ...

remote call of sys.object_definition()
Hi guys. I am trying to compare the db objects on our new 2008 server with those on the 2005 server. we have the 2005 server set up as a linked server using NT authentication. here is my query to get all of the objects which don't match [code] with bfld2008 as ( select o.object_ID,coalesce(OBJECT_DEFINITION(o.[object_id]),t.name) as 'description',o.name, o.type,o.type_desc from [sys].objects o left join sys. tables t on o.object_id = t.object_id where o.type in ('P','V','IF','FN', 'TR','U') ) , bfld2005 as ( sele...

need fire template with sounders,call points and detectors
is there a fire template for fire alarm systems and emergency lights ...

How draw x-y picture
Hello: My work often need to draw picture. Suppose the function y=f(x), I have already got the discrete data of x and y: x: x1, x2, ........, xn; y: y1, y2, ....., yn how to draw them in the x-y coordinates? Excel does have ' insert |chart' and be able to draw a lot of types of pictures, but I did not find the way to draw x-y line picture as x and y all designed by ourself. Hi, "Insert" --> "Chart" --> "XY-Scatter" --> select the "Chart Subtype" you want --> select "Series" Tab --> ent...

listbox
I have a listbox in my Form. When I navigate to other records using the Form's navigator the listbox does not corresponds to the record. How do I make it to corresponds accordingly. Thanks in advance ChoonBoy, Use the OnCurrent event of the form to Requery your listbox. As you browse to each record, the Requery will "re-synch" the listbox according to some value on that particular record. -- hth Al Campagna Microsoft Access MVP http://home.comcast.net/~cccsolutions/index.html "Find a job that you love... and you'll never work a day in you...

=<expr> function call
Greetings, I am new to the MS Access product, but have experience writing DB middle ware in other environments. Right now my challenge is this: I want to write an expression in a report control that is a complex expression of the record fields. I see how to directly write an expression referring to the record fields like [Customer Name] and so on, and I also see how to make a function call passing one or more fields as function arguments as above, but what I really want to do is pass a reference to the current record, and then within my function be able to refer to all the different fiel...

Calling GetDC from COM vs WinApp
when I call GetDC from MFC Dialog Based application i called like this CDC* pDC = GetDC(); but when created an ATL COM project and added function , i can not call it same way the signature there HDC GetDC(HWND hWnd); how can i get the CDC * ,as in window app? Raed Sawalha wrote: > when I call GetDC from MFC Dialog Based application i called like this > > CDC* pDC = GetDC(); > > but when created an ATL COM project and added function , i can not call it > same way the signature there > > HDC GetDC(HWND hWnd); > > how can i get the CDC * ,as in window app...

Drawing Graphs #2
Hello, I need to write an application that displays multiple graphs on multiple tabbed sheets in a single window. The graphs are all simple X-Y line graphs like you'd see on an oscilloscope, but with labeled coordinates. I need everything (including the fonts if possible) to scale as I resize the window. I'm debating about using MFC or C#. Is there some standard class or set of functions that supports such graphs or do I need to write my own from the ground up (or buy a 3rd party package)? We've already done this in Java but I'd like to get rid of the Java and r...

MNY97 Has Stopped Making Outgoing Calls
When trying to send payments that are listed as ready to send, the Call Progress window hangs. There is a flashing down arrow in task bar at bottom of screen. Windows Task Manager says that MNY is running, but there is no indication that the call is being made; i.e., no activity at the DSL modem or at the windows sys tray Internet icon (Two computer monitors). I used WinTaskMgr to end the task. Reopened MNY and same problem occurs. Have not rebooted computer. Can use browser as normally done. XPSpro. Can anyone suggest cause/remedy ? Thanks. ~ Vince ~ Have determined that error ...

Drawing Portability
I've been given access to a copy of Visio to review (2007 Standard version). Out IT administrator tells me that the hand-me-down machines we have in the field won't support any Visio 2007 product, so I work on a conference room machine after hours. I need to prove to my boss that another license is worth buying. I've produced a number of drawings that have proved useful. Our employees recently saved a lot of money by reducing the amount of time we needed to have a crane on-site; my contribution was a Gantt chart that was used to help coordinate the efforts of multiple work...

Drawing realtime line graphs
I'm creating an application that will consist of a main view of a CMFCListCtrl with multiple CMFCDockablePanes displaying the listed data in a line graph format. I know there isn't a control that does graphs, so I'm assuming i will be creating my own. I have some experience with computer graphics using openGL, but thought openGL might have too much of an overhead for simple 2D drawings. What do you recommend as the base technology of creating my own 2D line graph? I'm also thinking of placing these graphs within their own views so when the list gets updated, the ind...

drawing bell graphs side-by-side
i'm trying to draw two normal distribution bell graphs side by side in a same drawing. i was able to draw two different bell graphs following the help provided earlier, but still cannot draw them together with some overlapping tails. perhaps, the difficulty i have is "selecting" the columns (range?) . i "selected" all four columns (two columns for taller graph, and the other two columns for shorter graph), but it draws a linear graph. any help is appreciated. Provide more detail about exactly what you did and what results you got to help us identify wh...

Hyperlinks in listbox
Is it possible to have a listbox actually display the hyperlinks in its rowsource? TIA Greg ...

which sqlcedatareader method should I call for a numeric field?
I am developing a sql server 2005 ce appliaction. I have a numeric(18,10) filed in my db table. When I call oReader.GetDouble(0) after oCmd.ExecuteReader() and oReader.Read(), I got a sql exception: invalidCastException. So I am confusing... Which other method should I call for numeric field than GetDouble()? Thank you in advance. > So I am confusing... Which other method should I call for numeric field > than GetDouble()? SQL Server numeric and decimal data types map to a .Net decimal. See http://msdn.microsoft.com/en-us/library/4e5xt97a(VS.80).aspx for a com...