|
I’m about to store about 10-20.000 elements (MyType) in a collection. I would like to have some kind of order because I have to search for one or more elements quite often.
I’ve thought of a AVLTree which I am comfortable with. The problem is that I would like to enable multiple search and retrieve all successes in a list or something for future manipulations.
Pleased for all suggestions…
...and justice for all
APe
|
|
|
|
|
One way would be to put the items in a CArray object, and then use qsort() to sort them.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
Hi,
I want to attach one of the menu resource to one of my child frame but i am not able to do so. I am putting code below, the following code is written in the App class and will execute on the click of a button:
CQSMChildFrame *pQSMMiniFrame = new CQSMChildFrame ;
if(!pQSMMiniFrame->LoadFrame(IDR_QSM,WS_OVERLAPPEDWINDOW | WS_CHILD, m_pMainWnd))
{
AfxMessageBox("Could not load QSM Frame");
return;
}
HMENU hMenu = NULL;
LPTSTR lpszMenuName = MAKEINTRESOURCE(IDR_QSM1);
if (lpszMenuName != NULL)
{
HINSTANCE hInst = AfxFindResourceHandle(lpszMenuName, RT_MENU);
if ((hMenu = ::LoadMenu(hInst, lpszMenuName)) == NULL)
{
AfxMessageBox("Warning: failed to load menu for CFrameWnd.\n");
return;
}
}
CMenu menu;
menu.Attach(hMenu);
BOOL y = pQSMMiniFrame->SetMenu(&menu);
pQSMMiniFrame->BringWindowToTop();
pQSMMiniFrame->SetOwner(m_pMainWnd);
pQSMMiniFrame->ShowWindow(SW_SHOW);
pQSMMiniFrame->UpdateWindow();
where CQSMChildFrame is derived from CMDIChildWnd and the application is an MDI based application.
When i debug the application, if fails at the SetMenu() line and returning false.
Even i tried loading and setting menu in the OnCreateClient() handler of CQSMChildFrame but not successful there also.
Please help me what i am doing wrong?
Thanks,
Amit
|
|
|
|
|
Hello all,
I have a dialog that has the style - popup and none (for border)
I've created a round edges for the that dialog using the following code:
CRect rc;
GetClientRect(rc);
CRgn rgn;
rgn.CreateRoundRectRgn(rc.left,
rc.top,
rc.right,
rc.bottom,
15,
15);
SetWindowRgn(rgn,TRUE);
now i try to draw a border for this border-free dialog, using the following code:
void CMyDlg::OnPaint()
{
CClientDC dc(this);
CPen pen(PS_SOLID,2,RGB(0,0,0));
CPen* pOldPen = (CPen*)::SelectObject(dc.m_hDC,pen);
CRect rc;
GetClientRect(rc);
dc.MoveTo(1,1);
dc.LineTo(rc.Width()-1,1);
dc.MoveTo(rc.Width()-1,1);
dc.LineTo(rc.Width()-1,rc.Height()-1);
dc.MoveTo(rc.Width()-1,rc.Height()-1);
dc.LineTo(1,rc.Height()-1);
dc.MoveTo(1,rc.Height()-1);
dc.LineTo(1,1);
::SelectObject(pDC->m_hDC,pOldPen);
}
the trouble is , since i've create the round edges, there is no drawing on them, i tried to use the dc.Arc method, but i don't know how to calculate the exact arc....
can any1 show me the proper code, so the dialog rounding would have a drawn border as well?
thanks in advanced
Yaron
Ask not what your application can do for you,
Ask what you can do for your application
|
|
|
|
|
<br />
CRect rc;<br />
GetClientRect(rc);<br />
<br />
rc.Deflate(3,3);<br />
<br />
CDC::RoundRect(rc, CPoint(15,15));<br />
Just make sure you have an empty fill-brush and this should do the job more or less.
|
|
|
|
|
many thanks ohad
worked like a charm!
but, if i don't use the deflaterect then the rectangle is not shown pretty good,also if i use 3,3 as you did, i see the edges of my dialog under the rectangle...? how can u fit the round rectangle exactly?
thanks again
Yaron
Ask not what your application can do for you,
Ask what you can do for your application
|
|
|
|
|
I've used javadoc.exe to generate documentaition for my java-projects.
Any suggestions on a good way to do it in Visual C++?
...and justice for all
APe
|
|
|
|
|
create it in the form of .hlp file and for the VC++ application save this help file in the VC++ Application's help file path. You have to change value of helpfilename variable for your CWinApp derived class.
|
|
|
|
|
How do I create a .hlp file?
How should I comment my sourcecode?
...and justice for all
APe
|
|
|
|
|
|
This links has a lot of c++ documentation tools.
http://www.stack.nl/~dimitri/doxygen/links.html
I recommend Doxigen.
|
|
|
|
|
|
Hey somebody help me!
pl tell how to save a browsed page through VC++
pl help me..
|
|
|
|
|
Hi everybody,
Does anybody know, how I can use a WTL splitter window in an MFC 6.0 project? I want to have a more flexible splitter window in my MFC application. please explain it in detail.
thanks in advance,
Roozbeh.
|
|
|
|
|
Im querying the counter
"\\Processor(_Total)\\% Processor Time" using Pdh functions. But during the first query (PdhCollectQueryData, and PdhCollectQueryData) I am getting the value fmtValue.longValue (Query result) as 99 always. But during the consecutive calls it returns the appropriate CPU usage values. I susected this as the CPU used during the call - But windows Taskmanager doesnt show that (99). Can someone explain this - Thks in advance! Wilson
|
|
|
|
|
What are you expecting the value to be?
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
Im expecting the CPU usage % on my machine, which is not 99% actually (verified using TaskManager). But it returns 99 only in the first call. It returns the actual CPU usage (normallu 1-10 on my machine) in the consecutinve calls.
|
|
|
|
|
hey i have a program with several edit boxes that are numeric only my problem is i also need to enter negative values but i dont want to allow people to write text in there is there a way around it so itll allow users to input a - sign before thier number?
|
|
|
|
|
you can use edit->SetWindowLong
and use style as ES_NUMBER
|
|
|
|
|
Anonymous wrote:
use style as ES_NUMBER
Which limits the control to numbers only.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
You can go through my article Numeric Edit Control[^] to find an answer to your problem. You can also download the complete source code with the article and use it as it is to save your time (of course only if you are working with MFC).
Regards,
Gurmeet BTW, can Google help me find my lost pyjamas?
My Articles: HTML Reader C++ Class Library, Numeric Edit Control
|
|
|
|
|
i tried SMTP samples for sending email, but the samples display error "can not find SMTP mail server".
how to fix the problem?
thx
includeh10
|
|
|
|
|
includeh10 wrote:
how to fix the problem?
Does the SMTP server exist that you are referencing? If so, is it using port 25 for the SMTP service?
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
DavidCrow,
welcome to come back ....
how to know if "SMTP server exists"?
MS outlook works well on my PC.
cheers
includeh10
|
|
|
|
|
includeh10 wrote:
welcome to come back ....
Welcome back? Had I gone someplace?
includeh10 wrote:
how to know if "SMTP server exists"?
I would be inclined to ask my ISP about their SMTP server. If you are doing this from within a company, then ask the network administrator.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|