|
I think a good and easy example is in MSDN Here[^]
whitesky
|
|
|
|
|
can v call local function in the thread..if it possible its not runing in my program..now wat to do?
NooR
|
|
|
|
|
I hope this helpful for you
HANDLE thread;
<br />
void CYourClass::Runthread()<br />
{<br />
DWORD ThreadID;<br />
thread=CreateThread(NULL,0,ThreadFunc,this,0,&ThreadID);<br />
}<br />
<br />
void ThreadFunc( LPVOID lpv )<br />
{<br />
CYourClass* m_Class = (CYourClass*) lpv;<br />
m_Class->Function();<br />
}<br />
<br />
void CYourClass::Function()<br />
{<br />
MessageBox("Test");<br />
}<br />
whitesky
|
|
|
|
|
The two articles I provided are at the elementary level. What part is troubling you? Threads are usually not something to be tackled by a beginner.
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
hi can any1 give some info regarding multithreading in VC++. any application...............
When the goin gets tough then tough gets going
|
|
|
|
|
|
can u tell me about createthread method
When the goin gets tough then tough gets going
|
|
|
|
|
From the MSDN
<br />
The CreateThread function creates a thread to execute within the virtual address space of the calling process.<br />
whitesky
|
|
|
|
|
ooola rocks wrote:
can u tell me about createthread method
MSDN Library is your friend Man.. Just Type the Api... you will know every thing about it
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
how can i get the current selected item from listcontrol.
thanx
|
|
|
|
|
|
hi
thanx but i want the text not the position of selected item.
how can i get it.
thanx
|
|
|
|
|
|
hi
thanx
i hav tried like this
Position pos = m_listctrl.GetFirstSelectedItemPosition();
str = m_listctrl.GetItemText(pos,1);
then it gives me error
error C2664: 'CString CListCtrl::GetItemText(int,int) const' : cannot convert parameter 1 from 'POSITION' to 'int'
how to get the current index in int format.
thanx
|
|
|
|
|
You have to use GetNextSelectedItem(Pos)to get the item index, this will return the item index as 'int', use this 'int' value in GetItemText() and assign 0(zero) to subitem if you are not using the ListCtrl in Report View
|
|
|
|
|
You have to use GetNextSelectedItem()to get the item index, this will return the item index as 'int', use this 'int' value in GetItemText() and assign 0(zero) to subitem if you are not using the ListCtrl in Report View
|
|
|
|
|
hi thanx
its working now but there is a problem..
i get the seleted string into the String variable and displaying the it in the MessageBox().
what is happing when i click on any item it shows the text but it shows the messagebox three time.
why is this happening.......plz tell me
thanx
|
|
|
|
|
aavesh wrote: what is happing when i click on any item it shows the text but it shows the messagebox three time.
It sounds as though you are responding to the LVN_ITEMCHANGED message. When you select an item, more than one item has changed at that point. Study the NMLISTVIEW structure for details.
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
ok tell me which message i should pass for selecting item in listControl.
for a simple list box there is lvnselchange message.
but for a ListControl which one should i use.
thanx
|
|
|
|
|
Try this
CListCtrl::GetSelectionMark
Regards,
FarPointer
Blog:FARPOINTER
|
|
|
|
|
which message i should pass for selecting item in listControl.
|
|
|
|
|
try this
LVM_SETSELECTIONMARK
Regards,
FarPointer
Blog:FARPOINTER
|
|
|
|
|
If you are using MFC, use the CListCtrl::GetNextItem(-1, LVNI_SELECTED) method.
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
will this function return me the current item ..when i tried this function it give me error
"LVS_SELECTED is uncdeclare identifier"
thanx
|
|
|
|
|