|
Mark,
where do I put this LVS_EX_FULLROWSELECT. I don't see that style in the dialog resource view, and have tried programmatically setting it via SetExtendedStyle, but maybe I am doing it wrong, I've created a control member variable for my dialog of type listview, which has the LVS_REPORT style via the dialog resource editor checkboxes.
I've tried m_Table.SetExtendedStyle(LVS_EX_FULLROWSELECT);
but maybe I'm doing it in the wrong place or wrong way?
|
|
|
|
|
OK I have found that and it now works, I had it in the wrong block of code
All I need now is which message I need to handle so that if the user clicks an item in the row, I can then use the SetExtendedStyle call, or can that be done in the InitDialog?
Also, I am still having problems selecting anything other than the 1st column item - I thought the FULLROWSELECT allowed you to select a row by clicking any of the items?
|
|
|
|
|
oh!
putting it in OnInitDialog seems to have done the trick!
many thanks
|
|
|
|
|
Cool! Yeah, OnInitDialog should be a good place to set the style
Glad you got it working!
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Thanks Mark.
Now, if only I could programmatically set the selected state - so that if data is added to the table in a particular row, it's highlighted as though the user clicked that row, it would be perfect. Have tried the SetSelectionMark but that doesn't seem to be it! Do you know how that's done~?
|
|
|
|
|
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).
|
|
|
|