|
LVIS_SELECTED (SetItemState()) should be the message you want to use.
state, stateMask LVIS_SELECTED | LVIS_FOCUSED
You may need to remove the slected/focused state from the previously selected item(s)...
LVM_GETNEXTITEM (GetFirstSelectedItemPosition()/GetNextSelectedItem()) will help find those.
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Hello,
If I have vector of int and vector of strings
vector<int>IntVector
vector<string>StringVector
and now I want to compare an int a within IntVector
and string s within StringVector
which comparison or search within these vectors will take more time.
I expect the size of vectors to be 100000.
so will it make a significant difference.
Prithaa
|
|
|
|
|
prithaa wrote: which comparison or search within these vectors will take more time.
Why don't you implement both and time them, then tell us?
led mike
|
|
|
|
|
prithaa wrote: which comparison or search within these vectors will take more time.
Without actually testing it myself, I'd say comparing strings would be slower.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hello,
Thanks
Even I thought strings would take more time.
Pritha
|
|
|
|
|
Hi,
Why don't you try to compare ASCII code? It can be the easiest way, as long numbers and letters are there and are different, and you can use higher than, lower than, equal... as well.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
|
|
|
|
|
Hi, in my application I'm setting the fonts of some controls through WM_SETFONT by creating a LOGFONT and then calling CreateFontIndirect to create an HFONT from the LOGFONT.
For some reason the fonts don't look the same in debug and release mode. Also they look different on different computers. Is there a better way I can set the fonts, a more "standard" way that would look the same on all systems/modes?
For instance I wish I could just say, make the font 10 point FixedSys font. But with LOGFONT I have to give it lfHeight and lfWidth which seems somewhat arbitrary.
Thanks for help!
KR
|
|
|
|
|
KellyR wrote: But with LOGFONT I have to give it lfHeight and lfWidth which seems somewhat arbitrary.
Probably not much help, but...
I get consistent results across machines by setting only the lfHeight, lfWeight,
lfPitchAndFamily, and lfFaceName members of the LOGFONT struct. The rest of the members are set
to 0. I use a negative height and let the system pick the appropriate width.
The only inconsistency I've experienced is when using a specific font that does not come pre-
installed on all systems (so the font gets mapped to the closest match, not always good).
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
I didn't realize I could use negative height to have the system auto-set width; this seems to make everything work correctly in my program. Thanks much!!
KR
|
|
|
|
|
Use (or lookup the implementation of) CFont::CreatePointFont(...) - it is great for creating fonts of specific point sizes. For example:
CFont fMyFont;
fMyFont.CreatePointFont( 100, _T( "FixedSys" ) );
Peace!
-=- James Please rate this message - let me know if I helped or not!<HR> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
hello, I have an project which generate boxes(bin packing) and I want to save the results on the disk(in the memory) so I can use this results in matlab or to save this results in xml so i can use xml for further reaserch please..if you know how can i do this help me ........if you can give me some clues... thanks
lavi
|
|
|
|
|
you have to know the structure of the files matlab is waiting for...
is this basic text, or binary one ?
|
|
|
|
|
if is basic test how can I save my results ...please help me... I realy need help
|
|
|
|
|
File I/O is file I/O regardless of what you put into the file. Do you know how to write to, and read from, a file?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
|
If you are using C++, then I would suggest file I/O from the STL. See here and here.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
we've got a dialog window and are using the Power point object model to run the slide show. We've set that power point slideshow window into the main dialog window's client area by using SetWinodwPos(). The slide show runs properly, the problem is that if we click Deskop button (Show desktop) on quick launch toolbar it gives some painting issues. The slideshow window set into client area of dialog doesn't paint itself clearly. What should we do to overcome these painting issues ? Do we need to handle EraseBkground or WM_PAINT of dialog window ? what should be our move in this case ?
- Malli...!
|
|
|
|
|
Example, I have a 2-channel mp3 file ( left channel and right channel ), I want to mute left(right) channel of this file when it is playing. In Visual C++, what function need for this? And How to use it? Help me, please.
|
|
|
|
|
Hai All,
I have a doubt regarding the transfer of Data in InterProcess
communication like Socket Programming.
->Client and Server are two different Process running in two different
machines
->Assume , I am passing a user defined structure from client process to
Server Process.
->As usual I will fill the structure with values and pass the address
of structure to the server process.
->My doubt starts here , since Server is another process running in
another address space and also in another machine, how can the
server fetch the values stored in the address given by client.
Are they sharing any memory ??, if yes, where it resides ??,
Thanks
George
|
|
|
|
|
When you pass a "pointer" to be sent over a communication link (it can be serial port also), you supply also a size. So, what the send function is simply doing is copying X (the size you supplied) bytes starting at the address you supplied (the pointer). So, there is no magic there (or no shared memory or whatever). But, of course you have to take care that what you send is a pure data block (so, if there are pointers in your structure, the address will be sent, with no possibility to extract the data at the other side).
|
|
|
|
|
Hi Sir,
Thank you very much for ur Reply.
Thanks and Best Regards
George
|
|
|
|
|
georgekjolly wrote:
->As usual I will fill the structure with values and pass the address
of structure to the server process.
What? It's not passing the pointer itself. We just tell the API function from where it should take the structure. We are pointing addresses to the function and NOT!! to the machine that's on the other end!
-- modified at 11:53 Thursday 10th May, 2007
Press: 1500 to 2,200 messages in just 6 days? How's that possible sir?
Dr.Brad :Well,I just replied to everything Graus did and then argued with Negus for a bit.
|
|
|
|
|
How to Place a menu in th bottom in a dialog based application
Thanks In Advance
|
|
|
|
|
Hi,
From MSDN:
CMenu::DrawItem
This member function is called by the framework when a visual aspect of an owner-drawn menu changes.
Syntax
virtual void DrawItem( LPDRAWITEMSTRUCT lpDrawItemStruct );
Maybe Position has something to do with this too.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
|
|
|
|
|
Hi All
I am doing project in VC++ 6.0.So my requirement is that i want to change font of ToolTip control.
I create class which is derived from CToolTipCtrl class.In derived class i tried by override OnDrawItem() funtion and OnPaint()function but there is no effect on font.All ToolTip display in System default font.So if anybody have some hint,then please give me.
Thanks in Advance
Atoool
am
|
|
|
|