|
|
If you are wedded to MFC, at least use a CObArray instead of a CObList. The algorithim will be much cleaner and faster with a smaller memory footprint.
For instance ...
typedef CTypedPtrArray<<CObArray, CDrawObj*>> CDrawObjArray;
then create the array ...
CDrawObjArray ObjArray;
const unsigned int nSize = 5;
ObjArray.SetSize(nSize);
fill the array ...
for(int i = 0; i < nSize; i++)
{
CDrawObj* pObj = new CDrawObj(CRect(ptOrigin,sizeRect));
ObjArray[i] = pObj;
}
and finally sort the array (using the most inefficient sorting algorithim known to man).
for(int i = 0; i < nSize; i++)
{
for(int j = i; j < nSize; j++)
{
unsigned int nPrevious = ObjArray[j-1]->m_position.left;
unsigned int nCurrent = ObjArray[j]->m_position.left;
if(nPrevious > nCurrent)
{
CDrawObj* pObj = ObjArray[j-1];
ObjArray[j-1] = ObjArray[j];
ObjArray[j] = pObj ;
}
}
}
modified 17-Jan-19 15:57pm.
|
|
|
|
|
Michael Waters wrote: ...(using the most inefficient sorting algorithim known to man).
I can think of one worse.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
Guys , you're overcome me with solutions !!! I want to kindly thank you ! I was learn something here .And after all , seems to must begin use STL ... I will googling and see what I find ... You are very kind !
|
|
|
|
|
hi,
I don't know Graphics in vc++? i want how to develop line graph in vc++?
Win32 GUI use line graph is possible?
any sample code or url please give me
Regards,
M.Mathivanan
|
|
|
|
|
I don't understand from your query on which base do you want to draw the line on.
If it's a Win32 SDI application, you can get the device context and then draw the lines on the graph using the MoveTo and LineTo API's.
I am a HUMAN. I have that keyword (??? too much) in my name........
_AnsHUMAN_b>
|
|
|
|
|
|
Are you using MFC or pure win32 API ? If you are using MFC, take a look at my sig for a charting control I wrote for codeproject.
|
|
|
|
|
|
pDC->MoveTo(x,y);
while(oPoint in points collection)
{
pDC->LineTo(oPoint.x,oPoint.y);
}
onwards and upwards...
|
|
|
|
|
ms chart active x control can be alternative
|
|
|
|
|
Hi all,
I hope that i posted my question in the right place
I would like to know, if there is some examples or courses to create a little application using RTP in order to visualise my webcam video throught the browser. (on localhost host or network)
I'm using VS2005 + DirectShow.
Thank you.
"The Ultimate Limit Is Only Your Imagination."
|
|
|
|
|
well.. one option is to develop it as an activex control, and use in browser. You may first make it as a stand alone application to refine the working, then convert it as activex. Google for samples, you will get like this.
|
|
|
|
|
ok ...
Do u mean that i have to create an activex probably a one for capturing frames and then add the activex to the browser or what exactly?$
I'm new to DirectShow and i'aint a wed developper.
could u explain more plz ?
"The Ultimate Limit Is Only Your Imagination."
|
|
|
|
|
yes, exactly. Using Directshow is easy to learn, and you shouldn't be a web developer to develop and test an activex control.
|
|
|
|
|
but how could i add an activex to a web page browser ?
"The Ultimate Limit Is Only Your Imagination."
|
|
|
|
|
|
I saw these lines in an example code. I am not clear about it.
CListVieiw::OnInitialUpdate();
CListCtrl & theCtrl = GetListCtrl();
My questions are
(1) Is GetListCtrl()( on the second line) a member function;Which class does it belong to?
(2) what does the '&' mean at the left hand side?
|
|
|
|
|
cy163@hotmail.com wrote: (1) Is GetListCtrl()( on the second line) a member function;Which class does it belong to?
See here.
cy163@hotmail.com wrote: (2) what does the '&' mean at the left hand side?
See here.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
Thank you DavidCrow for your reply.
I wonder what exactly is the role of GetListCtrl(); generate a instance of ListCtrl? or sth else?
|
|
|
|
|
cy163@hotmail.com wrote: I wonder what exactly is the role of GetListCtrl(); generate a instance of ListCtrl? or sth else?
To get a reference to the list control associated with the view.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
Thanks again.
However, what if there are more than one list controls associated with the view.
|
|
|
|
|
cy163@hotmail.com wrote: However, what if there are more than one list controls associated with the view.
Then you'd have more than one view.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
You mean ONLY one ListCtrl can be associated with one view?
If so, Why there may be more than one ListCtrl in a dialog
Or, I misunderstand the view concept. I think a dialog essentially is a view.
|
|
|
|
|
cy163@hotmail.com wrote: You mean ONLY one ListCtrl can be associated with one view?
Yes, unless the view is a CFormView .
cy163@hotmail.com wrote: If so, Why there may be more than one ListCtrl in a dialog
Because a dialog is not a view.
cy163@hotmail.com wrote: Or, I misunderstand the view concept.
Perhaps. But, have no fear, there's plenty of online documentation/examples to help you out.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|