|
Hi,
I am using an STL priority queue for an application. However, I want to change priorities of the entry at run-time. What is the best way to do this?
Anyone know of any good resource that deals with this?
Thanks,
Pankaj
Without struggle, there is no progress
|
|
|
|
|
thank u!
|
|
|
|
|
Recursively.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
can u t ell me more detail. such as find who is parent and who is child
|
|
|
|
|
Well, if you're recursing down every branch, then the parent is the one you just found before this one, and the child is the one you find next. Clearly if you want to rebuild a tree that you've saved to disk, you need to save not just the data, but tokens that tell you where the data goes.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
Seems like lots of kids waited until the end of the holiday weekend to do their homework.
Software Zen: delete this;
|
|
|
|
|
|
faint!
|
|
|
|
|
Not sure if this has been mentioned before ...
Dictionary's definition of recursion:
See Recursion
--
Paul
"If you can keep your head when all around you have lost theirs, then you probably haven't understood the seriousness of the situation."
- David Brent, from "The Office"
MS Messenger: paul@oobaloo.co.uk
Sonork: 100.22446
|
|
|
|
|
i assume yr tree is just a link list.
u have to arrange all items in a consecutive chunk of memory before u attempt to serialize them. and each item should have some sort of ID to identify itself (example: nLevelID - to identify the depth of an item relative to root node, nItemID - identify the relative position of an item within a given level). This is necessary so that we u read back this memory from disk, u can interpret the memory and locate individual items and reconstruct the tree.
good lcuk
norm
|
|
|
|
|
I wrote an MFC Draw application that allows the user to draw a Line and a Rectangle. I am trying to implement 'ROTATE' for the Line and the Rctangle. Does anyone know how to rotate the Bounding Rectangle for the objects???
Doru
|
|
|
|
|
The first thing that you will need to do is represent your rectangles as a set of four points rather than two that is done with the RECT structure.
The next thing that you do is apply this rotation matrix to each point in your rectangle to rotate it, where A is the angle that you would like to rotate in radians:
cos(A) -sin(A)
sin(A) cos(A)
your final formula will look like this:
POINT pt;
POINT pt_rotated;
pt_rotated.x = pt.x * cos(A) - pt.y * sin(A);
pt_rotated.y = pt.x * sin(A) + pt.y * cos(A);
This formula is a rotation at the origin. Therefore you will need to translate the points to the origin before you rotate, then after the rotation, translate the points back.
Good Luck
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
I wrote an MFC Draw application that allows the user to draw a Line and a Rectangle. I am trying to implement 'RESIZE' for the Line and the Rctangle. Does anyone know how to resize the Bounding Rectangle for the objects???
Doru
|
|
|
|
|
I strongly suggest to check out a sample called DrawCli (MSDEV CD samples).
|
|
|
|
|
do you have the doc for the DrawCli ?
i feel good.
|
|
|
|
|
zhdleonid wrote:
do you have the doc for the DrawCli ?
what do you mean by doc? That's a sample source code, so the doc is the source code. And the debugger breakpoints come to the rescue for tiny details.
|
|
|
|
|
How can I have a toolbar bitmap with more than 16 colours? The resource editor doesn't like anything else and wants to "fix" it whenever I try
|
|
|
|
|
Open the bitmap in the resource editor, view properties, and change the colors to 256. The VC editor doesn't support more than 256, so if you need more colors you'll need to use some other app to create the bitmap.
--Mike--
"Adventure. Excitement. A Jedi craves not these things."
-- Silent Bob
1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
u can use ms paint app edit it
|
|
|
|
|
How can I implements a tab control window like in Visual Studio Net. Tab controls can be displayed either horizontally, or vertically and docked to any inner side of the window. Tab items in the tab control window can also be grouped.
programming
|
|
|
|
|
what's the best way to send an email from my WIN2000 adv server? if i do NOT have SMTP server running?
and what about WIN98/ME/XP/NT.. ?
norm
norm
|
|
|
|
|
1. MAPI
2. Write your own code that can talk to the remote mail server (the server where the recipient is). There are plenty of classes that do this, some of them on CP too. This approach would be better IMO if your program is a server and you need to send emails on a server like scale. MAPI has got a large footprint, and sucks in a server environment. With your own class you can at least optimize things to suit you.
I assume you want to send emails from your program. Otherwise you may need to install an email server, or use some other email server as a relay for your emails.
Regards,
Rohit Sinha
|
|
|
|
|
|
how can i return a string from one of the methods of a component created using ATL-COM in vc++ i want to use it in VB
|
|
|
|
|
Use a parameter declared [out,retval] BSTR* pRetval , for ex.
STDMETHODIMP CSomeClass::SomeMethod( BSTR* pRetval)
{
if ( NULL == pRetval )
return E_POINTER;
SysFreeString ( *pRetval );
*pRetval = SysAllocString(L"Hi Bob!");
return (NULL == *pRetval) ? E_OUTOFMEMORY : S_OK;
}
--Mike--
"Adventure. Excitement. A Jedi craves not these things."
-- Silent Bob
1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|