Implementing Find on a CListCtrl

I'm trying to implement something similar to 
the "CListBox::FindString " function but on a CListCtrl 
in Report View. 
I'm feeding the list with a simple CData class member 
(this class consists only of 3 CStrings), and after the 
list has been fed with all the info, i'm sending one 
CData variable to a function named "UpdateList (CData* 
pData)". 
In this function, i'm trying to find this pData in the 
List by doing this: 

void CWordToolView::UpdateList(CData* pData) 
{ 

.... 

LVFINDINFO findStruct; 
LV_ITEM editItem; 

findStruct.flags = LVFI_PARAM; 

findStruct.lParam = (LPARAM)pData; 

editItem.iItem = m_ListCtrl.FindItem(&findStruct); 
} 
But this doesn't seem to work - i keep getting -1 as the 
value of editItem.iItem - meaning it does not find this 
in the list.

Any ideas ?


0
anonymous (74722)
10/17/2003 11:34:33 PM
vc.mfc 33608 articles. 0 followers. Follow

1 Replies
729 Views

Similar Articles

[PageSpeed] 20

What you are trying should work if you have SetItemData for each item 
with a pointer to the CData object that you used.  Each CData object 
must be at a different address.  It will not compare the contents of the 
CData object -- it will look specifically for the memory address as the 
LPARAM (item data) of each item.

In article <0ba601c39507$37df5a00$a001280a@phx.gbl>, SpaCat says...
> I'm trying to implement something similar to 
> the "CListBox::FindString " function but on a CListCtrl 
> in Report View. 
> I'm feeding the list with a simple CData class member 
> (this class consists only of 3 CStrings), and after the 
> list has been fed with all the info, i'm sending one 
> CData variable to a function named "UpdateList (CData* 
> pData)". 
> In this function, i'm trying to find this pData in the 
> List by doing this: 
> 
> void CWordToolView::UpdateList(CData* pData) 
> { 
> 
> ... 
> 
> LVFINDINFO findStruct; 
> LV_ITEM editItem; 
> 
> findStruct.flags = LVFI_PARAM; 
> 
> findStruct.lParam = (LPARAM)pData; 
> 
> editItem.iItem = m_ListCtrl.FindItem(&findStruct); 
> } 
> But this doesn't seem to work - i keep getting -1 as the 
> value of editItem.iItem - meaning it does not find this 
> in the list.
> 
> Any ideas ?
> 
> 
> 
0
10/20/2003 1:28:52 AM
Reply:

Similar Artilces:

find cell in link file
Hello All, anyone knows how to identify the cells in an Excel sheet refering to an other Excel File (External Links) ?? Regards Herve -- herve ------------------------------------------------------------------------ herve's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=27314 View this thread: http://www.excelforum.com/showthread.php?threadid=486490 Hi Herve, Try Bill Manville's FindLink addin which is freely downloadable at: http://www.oaltd.co.uk/MVP/Default.htm --- Regards, Norman "herve" <herve.1yqq9y_1132398001.1254@excelfo...

How to implement this?
Greetings, I want to check if current application is the active window, if not, then I want the window blink. Just like MSN receives a new message when it is not active. How to implement that? My target platform is Win2K. Evan "music4" <music4@163.net> wrote in message news:Os85ecxTGHA.424@TK2MSFTNGP12.phx.gbl... > Greetings, > > I want to check if current application is the active window, if not, then > I > want the window blink. Just like MSN receives a new message when it is not > active. How to implement that? My target platform is Win2K. GetForegr...

Removing text in combo with anther FIND function
First and foremost thank you for taking a look at this post. Any help will be greatly appreciated. I am a novice Excel user trying to learn more about it and am experimenting with statements and formulas and I have run into a snag for which I can't get around. In the following working formula =IF(ISERROR(MID('Raw Data'!A1,FIND(" ",'Raw Data'!A1)+4,100))," ",MID('Raw Data'!A1,FIND(" ",'Raw Data'!A1)+4,100)) I get a result of "THIS IS A TEST OF THE EMERGNECY BROADCAST SYSTEM 8PM.P3.IF THIS WERE AN ACTUAL...

Find Sofas
Huge Selections at Great Prices The Convenience of OneCart! http://good-furniture-care.page.tl/ ...

How to implement CCheckListBox
How does one correctly implement CCheckListBox? Dhe docs say to derive your own class and then call Create(); I tried to do that. My code is the following in a file StdChkListBox.h: #include <afxwin.h> class CStdChkListBox : Public CCheckListBox { public: } The error returned was was error c2504: Public: base class undefined CCheckListBox is defined in afxwin.h, right? how come it isn't working? Any idea? C++ is case sensitive. Try 'public' instead of 'Public'. Something like class CStdChkListBox : public CCheckListBox { } -- Cheers Check ...

Find and Replace inside a Hyperlink XL2007
Hi, Is there any way I can use find and replace inside Hyperlinks. I can use Find/Replace in the Hyperlink title but not in the path it contains. -- Steve A man with a watch knows what time it is. A man with two watches is never sure. - Segal's Law ...

find class of a class instance
is there a function that returns to me the class of an instance? The only thing I know is typeid(...) AliR. "wanwan" <ericwan78@yahoo.com> wrote in message news:1177439353.696099.233020@n35g2000prd.googlegroups.com... > is there a function that returns to me the class of an instance? > If you have turned on Run Time Type Information (RTTI, on by default in VS2005, if I recall), you can find out what the type is, and even the print string for the class name. Look at RTTI. This is not the question you asked, but I'm interpreting what I think you might have mea...

finding where a file is stored
2003 Excel used to tell you where the file was if you did a Save-As. Now it doesn't. How do I find where a file is currently stored? What do mean by 'now it doesn't...' Nothing has changed... Anyway use this in any cell =CELL("filename",A1) to see the complet path and file name "Catherine" wrote: > 2003 Excel used to tell you where the file was if you did a Save-As. Now it > doesn't. How do I find where a file is currently stored? Thank you for your time. Perhaps I was mistaken about the version. I used to be able to go to Save-As, an...

Implementing Single Sign On #2
Thanks Mark & BigHaig, I tried it but its not working yet.I use SSL for my OWA authentication i.e https://servername/exchange.Could this be why its not working? -- Buchi On Thu, 13 Oct 2005 12:40:04 -0700, "Buchi" <Buchi@discussions.microsoft.com> wrote: >Thanks Mark & BigHaig, >I tried it but its not working yet.I use SSL for my OWA authentication i.e >https://servername/exchange.Could this be why its not working? Yes absolutley. You didn't say about making that switch on your previous posts. You must enter credentials when you use SSL. ...

Teams and Advanced Find
I need to create a view using advanced find however it does not appears that trying to pull a list of Opportunities for members of a team isn't possible? If I need certain people who are associated with a team how can I do this? Hi, Unfortunately, I don't think you can perform such a query using Advanced Find (apparently Team structures are going to be more prominent in the next release). A work around would be to add a picklist field to the System User entity. You'd then have to set that to whatever Team they belong to (or perhaps you could use the Territory field to do th...

Microsoft Dynamics CRM 3.0 Implementation For Large Corporation (August 2006)
How Microsoft CRM 3.0 could contribute and be a part of its computer environment. (Sales Module, MS CRM Security, Integration with Microsoft Dynamics GP 9.0/Microsoft Great Plains,Integration with IBM Lotus Notes Domino ,International Considerations, Competition) http://microsoft-crm-3.blogspot.com/2006/08/microsoft-dynamics-crm-30.html ...

Where can I find interior design stencils.
I have Visio 2000. I have used the office stencils for my office layout but would like some type of stencil for laying out both my home and office. Any help would be greatly appreciated. Gaston ...

Tool to find redundant DL's
Hello, Is there a tool to marry up common DL's and find ones that are repeated or very similar? We could then remove extra ones that are redundant. Thanks I suppose you could export the DL names into a CSV list. Then sort, arrange, format to the criteria that you're looking for. Excel might have something. James Chong vyaw2003@gmail.com wrote: > Hello, > Is there a tool to marry up common DL's and find ones that are repeated > or very similar? > We could then remove extra ones that are redundant. > Thanks ...

Adding colums for related entity to adv find grid doesn't return d
I'm working on an view using advanced find on the Email object. I want to display the phone number(s) in the grid of the contact associated with the email (as regarding). My problem is not picking the columns (using edit columns), but no data is displayed in those columns when I know there should be. As proof, after creating the view, saving and picking from my view list I can see the columns but no data - however, if I export to a spreadsheet data shows up. After further testing, if I export to a static spreadsheet - the data is missing. If I export to a dynamic spreadsheet - the d...

Windows Sockets implementation
I have used Winsock2 for my application to communicate with the device over TCPIP socket.I get the following sequence of events . 1. The Application that runs the Client socket is alive.But after about 24 hrs. the network connectivity for the Machine is disabled. 2. On further investigation of the issue I found that in the Event viewer the event has been noted as Event ID -2019 and the note alongside is "The server was unable to allocate from the system nonpaged pool because the pool was empty." Do help me out with this. As I have no clue as to why it behaves so. "Rohan Bh...

Finding items
(Microsoft Office Outlook 2003). After typing a word in the "Look for" box, clicking "All Mail folders" and clicking "Find Now", how can I tell what folder each result was found in? It works better if you use Advanced Find - the results tell you where the item resides. -- Milly Staples [MVP - Outlook] Post all replies to the group to keep the discussion intact. ALWAYS post your Outlook version. How to ask a question: http://support.microsoft.com/KB/555375 After furious head scratching, gcotterl asked: | (Microsoft Office Outlook 2003). | | After typing a ...

XL 2007: How to find out what keyboard shortcuts I've assigned to macros?
Over the years, I've recorded and written a lot of macros. (Probably time to take a week or two and go over them and delete at least half!) I assigned a keyboard shortcut to a lot of them. I seem to remember that before XL 2007, there was a keyboard organizer that I could go through and review what shortcuts I had already assigned to my macros. I can't find that in 2007, though. Is there an easy way to generate a list of all my keyboard assignments and what macros they go to? Ed I don't recall ever seeing any such keyboard organizer in 2007. Canned from a prev...

Where can I find information about word htm styles
I am working with documents created in word and then saved as HTM files. The issue is I am trying to decipher the documentation you see when you do 'view source' on an htm file created in word. I have searched the Microsoft site and cannot find any documentation on styles used such as mso-style-qformat or any of the mso type formatting. If there is a resource on the internet could someone please share the resource. thanks, -- Tucson Good luck with that. Sorry to say, but I think you will have difficulty finding any useful information. "I am working wi...

Finding MAX of a conditional range???
Hi everyone, I would like to know if there is a way /set of formulas/ to find MAX/MIN/ of a range that is defined by certain conditions. To be more specific I am giving an example: I need to find MAX of range of numbers /1, 3, 6, 8, etc./ and the range is defined by two dates. To each number correspond a specific date. In other words, I would like to find MAX of the range between two dates. I tried a combitanion of MAX and SUMPRODUCT formulas, but no success. Any help is welcome. kras -- kras ------------------------------------------------------------------------ kras's Profile: ht...

Yahoo! DomainKeys Implementation
So, my company has been noticing a large portion of our email sent externally is now ending up in 'Spam' and 'Bulk' email folders. We have a current and valid SPF record and are not listed on any blacklists. From my research, I have found all our emails are not signed with Yahoo!'s DomainKeys signature; which many front-end 3rd party spam filters are looking for...especially Yahoo! and MSN mailboxes. I have Googled until my eyes have bled and can find only general information pertaining to DomainKeys but virtually nothing on how to implement DomainKeys in our Exchan...

finding cell values
If I have a column of numbers and want to find which of these numbers add up to a specific value how do you do this using a formula? eg; have values 50, 28,32,19,42 and the sum value is 102. Can you make excel identify the values that make up to 102 without manually trying to find them yourself? You can use solver (add-in that comes with office) http://tinyurl.com/4doog is a link how to do it -- Regards, Peo Sjoblom (No private emails please) "mellowe" <mellowe@discussions.microsoft.com> wrote in message news:8FB0FA91-9A78-4561-BF0B-AA45480CD45E@microsoft.com... &...

Can't find email server
I just purchased Outlook 2007 and can't send or receive any email from my pop3 accounts. I am currently running Vista Home Basic. The "Enter Network Password" window keeps on popping up. Before purchasing Outlook 2007 I was using Microsoft Mail and my Popo3 email accounts were working fine. "lam8231" <lam8231@discussions.microsoft.com> wrote in message news:DAC1E929-2CAA-439C-9421-EE988A3A98CB@microsoft.com... >I just purchased Outlook 2007 and can't send or receive any email from my > pop3 accounts. I am currently running Vista Home Basic. The &q...

Find any cell with a specific format
I'm looking for a formula I can use to determine whether a cell contains variable data, but of a certain criteria. For example, I am looking to determine if column A has an Arizona license plate or any other plate. Arizona's plates are ABC1234 format. I tried to use an if statement =IF(A2<>???####,"Out of State","Arizona Plate") but it returns as an error. I put quotes around the ???#### and it looks for that specific format. I also tried FIND and SEARCH to no avail. Further clarification: I want to return all these plates as "Arizona ...

How to implement OnChar?
I have an application I wrote in MSVC4 and OnChar seems to work fine when I compile it for MSVC7. However, when I create my minimal "Hello World" program in MSVC7 and try to implement the OnChar Message handler, it never gets called. When I override OnLButtonDown, that works. Why does not not OnChar work? Thanks, Siegfried "Siegfried Heintze" <siegfried@heintze.com> wrote in message news:OSaMLwQmFHA.3900@TK2MSFTNGP09.phx.gbl... >I have an application I wrote in MSVC4 and OnChar seems to work fine when I > compile it for MSVC7. > > However, when I cre...

How to find RMS POS Serial number?
Hello, We are using RMS Store Operation and looking to buy RMS HQ to upgrade. Typically the serial number is on the box that came with the original disk. If we're not able to locate this, is there another way on the system to look that up? Thanks very much in advance, JP Why do you need the serial number? If yuo are on version 1.3 it is on the dongle. If you are not and are 2.0 you should have had a registration card. May be your reseller or distributor has a record of it if yo do not, Contact your reseller. Afshin Alikhani - afshin@retailrealm.co.uk Retail Realm = = = = = = ...