|
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?
|
|
|
|
|
DirectCD came with the easy CD Creator.... The problem is that you need to prepare the cd, and then you need to decide if you want to leave the cd open or not...
Best Reagard...
Carlos Antollini.
Sonork ID 100.10529 cantollini
|
|
|
|
|
Hi.
I am keeping a array of pointers to CView and CFormView derived classes. I want to access different functions and variables in each class. Because they are specific to each derived class, I need to type cast. I was wondering if there is another way to access the pointer to the class that will automatically access the top (or lowest?) level derived class. By this I mean if CXView is derived from CView and CYView is from CFormView, I can just xx.GetView[1] and it will return the pointer as a CXView or CYView and not Cview because there may be other views derived from CFormView in the array.
I hope I am explaining this right.
Stan the man
|
|
|
|
|
I don't know what you're trying to say, but if you use a C++ cast ( dynamic_cast<cxview*>(MyView) ), it will return NULL if it is not an object of that type.
Christian
I have come to clean zee pooollll. - Michael Martin Dec 30, 2001
Sonork ID 100.10002:MeanManOzI live in Bob's HungOut now
|
|
|
|
|
What I mean is I have an array
CView* view[20];
view[0] = ... derived from Cview
view[1] = ... derived from CformView
each view can be a view derived from Cview or Cformview etc. In each of these views, they have functions that I want to access.
So now if I want to access
((CXXView) view[0])->...
or ((CYYView) view[1])->...
I have to type cast it to get to access things.
Is there a way to do things so that it will return the ptr to the relevant derived class so that I do not have to explicitly type cast things?
Stan the man
|
|
|
|