|
Is there any way to pass a CListBox control to a function so it can be used in the function and so you can use the function with the different listboxes of a dialog. Lets just say for example i want to write a function to clear a CListBox control:
<br />
void ClearListBox(CListBox list)<br />
{<br />
int count = list.GetCount();<br />
CString Data[999];<br />
<br />
for(int i=0;i<=count-1;i++)<br />
{<br />
list.DeleteString(i);<br />
}<br />
and to use it i'd do this:
<br />
ClearListBox(m_Listone);<br />
ClearListBox(m_Listtwo);<br />
...<br />
Whats the easiest way to do something like this?
Kuniva
|
|
|
|
|
list.resetcontent() ?
---
"every year we invent better idiot proof systems and every year they invent better idiots ... and the linux zealots still aren't being sterilized"
|
|
|
|
|
sorry to disappoint you, i'm not one of those idiots, it was the matter that concerned me, the problem was only hypothetically speaking...
Thanks anyways.
Kuniva
|
|
|
|
|
Change it to:
void ClearListBox(CListBox& list) Passing a reference avoids making a copy (which I assume was the problem you ran into).
--Mike--
My really out-of-date homepage
Buffy's on. Gotta go, bye!
Sonork - 100.10414 AcidHelm
Big fan of Alyson Hannigan.
|
|
|
|
|
How about:
void ClearListBox (CListBox* pListBox)
{
ASSERT (pListBox != NULL);
if (pListBox != NULL) {
pListBox->ResetContent();
}
} To use it, do:
ClearListBox (&m_ListOne);
ClearListBox (&m_ListTwo); /ravi
"There is always one more bug..."
ravib@ravib.com
http://www.ravib.com
|
|
|
|
|
Is there any way to pass a CListBox control to a function so it can be used in the function and so you can use the function with the different listboxes of a dialog. Lets just say for example i want to write a function to clear a CListBox control:
<br />
void ClearListBox(CListBox list)<br />
{<br />
int count = list.GetCount();<br />
CString Data[999];<br />
<br />
for(int i=0;i<=count-1;i++)<br />
{<br />
list.DeleteString(i);<br />
}<br />
and to use it i'd do this:
<br />
ClearListBox(m_Listone);<br />
ClearListBox(m_Listtwo);<br />
...<br />
Whats the easiest way to do something like this?
Kuniva
:p
|
|
|
|
|
Instead of passing the whole ListBox, pass a reference to it or pointer. Like this:
void ClearListBox(CListBox &list);
or
void ClearListBox(CListBox *list);
and call it like this:
ClearListBox(m_Listone);
or
ClearListBox(&m_Listone); (in case of pointer)
Philip Patrick
"Two beer or not two beer?" <shakesbeer>
Web-site: www.saintopatrick.com
|
|
|
|
|
You were faster.
I vote pro drink
|
|
|
|
|
|
1.
void ClearListBox(CListBox* list)
2.
void ClearListBox(CListBox& list)
I vote pro drink
|
|
|
|
|
hehe, thought i should use a pointer there just didn't know how
Kuniva
Want, take, have.
(oh btw, best way of learning some language is by looking at examples, start large!) :p
|
|
|
|
|
Does anyone have a sample program that will create a named pipe using CreateEvent()? I source to a program that uses OpenEvent() and I'm reverse engineering it. I do not have the piece that creates the pipe so I'm not sure how to do it.
Thanks!
|
|
|
|
|
CreateEvent() creates.... an event and not a pipe
to create a named pipe use CreateNamedPipe()
lol
Philip Patrick
"Two beer or not two beer?" <shakesbeer>
Web-site: www.saintopatrick.com
|
|
|
|
|
I agree but it's fairly clear in this code that it's a pipe that they're using. If you want to see the source, go to http://www.eluent.com/source_code.htm and download elgrep.zip. I'm trying to use it for a find-in-files mechanism.
|
|
|
|
|
Why yu think it is a pipe? I looked at the code... It is an event, this is what I see
Philip Patrick
"Two beer or not two beer?" <shakesbeer>
Web-site: www.saintopatrick.com
|
|
|
|
|
suppose i put my mouse cursor on some list box item and that item's text cant be seen without scrolling horizontally.i want the text to get displayed when i bring my mouse over item
in class/resource view pane in VStudio editor
u can see this behavior.actually its tree view
i want to display the text for ListBox
|
|
|
|
|
Look in any back isue of MSDN, Paul Dilascia, wrote a article about that...
Best Regrards...
Carlos Antollini.
Sonork ID 100.10529 cantollini
|
|
|
|
|
Or, if you use a ListCtrl instead, the extended option LVS_EX_LABELTIP (defined as 0x00004000) will force this.
i ain't happy, i'm feeling glad; i got sunshine in a bag; i'm useless, but not for long; the future is coming on...gorillaz, clint eastwood
|
|
|
|
|
|
Is there any way to play MPEG file in vfw (Video for Windows)?
Jerzy
|
|
|
|
|
Yeah VFW, just selects the appropiate CODEC for you.
|
|
|
|
|
Hi.
I was wondering if there is a way to directly write to a CD-R or CR-RW from a VC program basically treating it like a hard disk or disk drive etc?
Stan the man
|
|
|
|
|
There exist expensive SDK's for CDR writing, which would make me presume it's not easily done without them.
Christian
I have come to clean zee pooollll. - Michael Martin Dec 30, 2001
Sonork ID 100.10002:MeanManOzI live in Bob's HungOut now
|
|
|
|
|
Sure you can do it if Direct CD is active.
|
|
|
|
|
I am not too familiar with Direct CD. Is there any where I can get more information?
|
|
|
|