|
NicolNghia wrote: How I can get text when click on it like Babylon
in Babylon, it take a image of the text under the mouse and convert it into text using by OCR method. I will be a little harder to make an OCR. but try ..
nave
|
|
|
|
|
ok the msdn library don t help me so mutch i need an example on how to find an item and subitems in CListCtrl from CEdit ! And when is find it i whant the list to be scrolled to see the rezults and the rezults must be fill in another CEdit !
Thank you ! and good luck in the future ! ... to all !
Bravoone
|
|
|
|
|
Did you see msdn its loop for finditem now what do you need?
|
|
|
|
|
Where in msdn i don t find the example ! ?
Bravoone
|
|
|
|
|
|
no,no,no the documentation msdn library doesn t help me so mutch because what is there i have just done , what i need is something else a more detailed structure for this : FindItem or CListCtrl ,examples included for me to see how its works ! and if i want this in my project ! you understand me now ? all i want is to search from a CEdit in CListCtrl (Report view) for items and subitems and the rezult must be fill in another CEdit !
WhiteSky ... maybe you don t understand me i don t know so mutch code and i need some help if is someone in this world who want to help me! ok i will be gone from this site if you tell me : nobody want to help you ! ok i will wait your answer !
Bravoone
|
|
|
|
|
//i write this example for you i hope its helpful for you
//in this example we have a CEdit and in this control we have a string(test) now we want to search this item in listctrl first we get this string from Editbox//and set it find1.psz = str22; in the loop we have a search and return value to index and convert(itoa) for show location these items in this list 0,3,6 and you get a -1 when it doesnt find any items//instead messagebox you can insert this value to another editbox
-----------------------------------------------
<br />
USES_CONVERSION;<br />
CEdit m_Edit;<br />
CString str22;<br />
TCHAR buffer[100];<br />
LVFINDINFO find1={0};<br />
<br />
m_Ctrl1.InsertItem(0,"test");<br />
m_Ctrl1.InsertItem(1,"test1");<br />
m_Ctrl1.InsertItem(0,"a"); <br />
m_Ctrl1.InsertItem(0,"b"); <br />
m_Ctrl1.InsertItem(0,"test"); <br />
m_Ctrl1.InsertItem(0,"a1"); <br />
m_Ctrl1.InsertItem(0,"b1"); <br />
m_Ctrl1.InsertItem(0,"test"); <br />
<br />
m_Edit.Create(WS_CHILD|WS_VISIBLE,CRect(0,0,100,23),this,1);<br />
m_Edit.SetWindowText("test");<br />
m_Edit.GetWindowText(str22);<br />
int index=-1;<br />
<br />
<br />
find1.psz = str22;<br />
find1.flags = LVFI_STRING;<br />
do<br />
{<br />
index=m_Ctrl1.FindItem(&find1,index);<br />
MessageBox(itoa(index,buffer,10));<br />
<br />
}while(index!=-1);<br />
<br />
|
|
|
|
|
Thank you so mutch for your help , now i will try to see ...
Thanks !!!!!!!!!!!!!!!!!
Bravoone
|
|
|
|
|
ok i am very close - its working but i have one more problem to rezolv : with | LVFI_PARTIAL | works but i have subItems very close to the search for ex : i search "6021" my list include this : 6000,6001,6002,6003...6021 and the answer he given to me is :"6000"
i have tried with |LVFI_STRING| but is not find anyting because i have spaces in my database (visual fox 6.0.) and i don t now wath to do its someone how have an ideea ?!
Thank you WhiteSky for your help !!!! Thank you !!!!!!!!!!!!!!!!!!!!!!
Please help !
Bravoone
|
|
|
|
|
Flaviu_2006 wrote: ...because i have spaces in my database...
So why don't you remove the spaces prior to adding the items to the list control?
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
You can remove space from your string then insert to listctrl
|
|
|
|
|
How can I remove spaces from my string ? i don t now how ? how ?The spaces become from the database and when i loaded ... in list ctrl ....?
How can i : FindItem in the second column and the 3- column ...etc.?
Because my string searches only in the first column and GetItemText from second column , 3 column etc . this is my code the code from yesterday is not good for me :
void CMyList::OnOK()
{
UpdateData();
m_list2.RedrawItems(0,m_list2.GetItemCount());
CString sName = _T("Name");
m_name.GetWindowText(sName);
LVFINDINFO stInfo = {0};
stInfo.flags = LVFI_PARTIAL;
stInfo.psz = sName;
int nItem = m_list2.FindItem( &stInfo );
if( nItem != -1 )
{
// the item is in the list control
CString sSecondColumnText = m_list2.GetItemText( nItem, 1 );
// set the text to the second edit box
m_rezult.SetWindowText( sSecondColumnText );
}
}
Only this code works !
I remind you :
0 1 2
----------------------------------
| Name | City | Country |
-----------------------------------
-----------------------------------
| George | London | England |
-----------------------------------
|George | NewYork | USA |
-----------------------------------
|George | Madrid | Spain |
-----------------------------------
all i want is to find in my list the country from example from my both edit boxes : m_name (sName) , m_city (sCity) , m_rezult(sRezult)
Please help me with my code ....!!!!(The data are from a database fox pro and have spaces when i loaded )is works only with (LVFI_PARTIAL) and is not so good!
I promise you when i finish my program i will loaded on codeproject !
and will be very usefull for many things !
Thanks for your help ! And i will wait your answer because i dont now how to continue i will try something but ...
Bravoone
|
|
|
|
|
I see your reply now did you get your answer?
|
|
|
|
|
ok i remouve spaces !... works ! but my same problem remain how to find in the other columns FindItem column 1,2 how when i find this my problems , i thing ... will be solved !
My code find only in first column (0) and give me the text from others all i wanth is to search in others columns 1,2 ... and thank you so mutch for your help ,you have no ideea what is that for me !Thanks again !!!!
Bravoone
|
|
|
|
|
CListCtrl::GetItemText has two items or four items index of item(one parameter) and nSubItem(two parameter)
now if you used this function in the loop you can find your item in another colunms and need to check this string with your string
(like InsertColumn or InsertItem that you can see two parameter)
|
|
|
|
|
you can give an example ? please !!!!!!!
Bravoone
|
|
|
|
|
Did you see reply Viorel.
|
|
|
|
|
Hi all,
I need to disable an Item in a CListBox By Double clicking on it .
How can I achieve it .
Please Help me
Thanks in Advance
George K Jolly
|
|
|
|
|
georgekjolly wrote: I need to disable an Item
how do expect the disabled item in the list box to behave
nave
|
|
|
|
|
if you dont need to this item you can delete it from listbox
|
|
|
|
|
I Just Need to make it Disable and After that I will Enable it , This is my need
|
|
|
|
|
It seems the CListBox class does not support "enabled/disabled" state of items.
I think instead of CListBox you have to try another class -- CCheckListBox -- and deal with the state of checkboxes.
I hope it helps.
|
|
|
|
|
Hello friends,
I have insert a active-x control in my dialog based application.
Through which i got the class caapi aapi.cpp and aapi.h
And i am able to call all the function which are in aapi.cpp thruogh wDlg.cpp by declare a object of aapi.
When i right click in active-x button it display all the events of function which are present in aapi.h/.cpp.
I dont know how to make use of that events or how to make connection between these events and my application.
Can u help me or any link .Thanks
|
|
|
|
|
Hi!!
I have a doubt regarding SendMessage() function. According to MSDN SendMessage syntax is as follow;
LRESULT SendMessage(
HWND hWnd,
UINT Msg,
WPARAM wParam,
LPARAM lParam
);
But I am not getting what wparam and lparam are erally used for. Its given in MSDN that they are jst for additional information about the msg.
Thx,
|
|
|
|
|
SendMessage(..) is mainly for user messages.
Say in one class you have two numbers and you have addition method in another class, now you can use the SendMessage as
SendMessage(AddtionMethodHWND, User_Msg, 5, 10)
you can send a structure or class as the Param values, but those have to be as pointers and the destination methos have to take care of deleting the allocated memory
PostMessage(..) also act as SendMessage(..),
PostMessage just send the message and continue executing the next line but SendMessage will wait untill the methos returns
Do your Duty and Don't expect the Result
|
|
|
|