|
Does anyone know how to make an application perform like the Windows Media Player. That is, it has the ability to hide the toolbar, menu, and caption. Then when the mouse goes into the area where the caption should be, the caption, menu, and toolbar all appear. When the mouse goes out of the area, it goes back to the hidden mode.
|
|
|
|
|
|
That won't work. The Media Player doesn't work that like.
|
|
|
|
|
I tried to use SetItemState to select items in a list. but the list is not updating the selection information, even I put a m_list.SetRedraw(TRUE) after that. Is this the right way or I miss something?
for (intRowCount = 0; intRowCount < m_list.GetItemCount(); intRowCount++)
{
m_list.SetItemState(intRowCount, LVIS_SELECTED, LVIS_SELECTED);
}
Thanks
|
|
|
|
|
Ajax95 wrote: ...but the list is not updating the selection information
Does the control have the LVS_SINGLESEL style? If so, only the last item will be selected.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
|
The following code sample demonstrates the selected items in the list control.
CListCtrl* pListCtrl = (CListCtrl*) GetDlgItem(IDC_YOURLISTCONTROL);
ASSERT(pListCtrl != NULL);
POSITION pos = pList->GetFirstSelectedItemPosition();
if (pos == NULL)
TRACE0("No items were selected!\n");
else
{
while (pos)
{
int nItem = pList->GetNextSelectedItem(pos);
TRACE1("Item %d was selected!\n", nItem);
}
}
Knock out "T" from CAN'T
You 'CAN' if you think you 'CAN'
|
|
|
|
|
Thanks for all of your help. I've find my mistake. I forgot the set the list attribute "Always show selection" to "true".
Thanks
|
|
|
|
|
Hi,
I'm trying to create list of presets for a small wave app I'm making, basically I have a few sliders controlling things like the attack and decay of a wave file.
I'm struggling to figure out how I can move the sliders around by selecting an item from a list box.
Hope this makes sense, any help would be great.
Thanks,
A Davies
|
|
|
|
|
antdaviesuk wrote: I'm struggling to figure out how I can move the sliders around...
If this is an MFC application, use the CSliderCtrl::SetPos() method.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
If you have 100 items in the list box then
SetRange of the slidercontrol to 100 and then
on click of the list control getcursel and set the pos of the slider to that index return from getcursel
Knock out "T" from CAN'T
You 'CAN' if you think you 'CAN'
|
|
|
|
|
I have a DLL and I want to create a lib file from the dll.
The dll exports class member functions and static member variables. I created a def file using a tool and added the DATA tag for every static member variable. Without DATA tag the linker process works, but with DATA tag, there are unresolved error messages with exactly these items... what is wrong?
Example from the DEF file:
?staticname@class@@0Vreturntype@@A -> works, but linker produces invalid code (takes it as function, not as data)
?staticname@class@@0Vreturntype@@A DATA -> LNK2001... why?
Thanks for advice,
Alex
Don't try it, just do it!
|
|
|
|
|
See here.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
I already had a look at that article, but it didn't help me in any way. The problem is why there is a linker error when I add the DATA tag, but no linker error without it!?
Don't try it, just do it!
|
|
|
|
|
Are you trying to access the static member variable from outside the file in which it is declared?
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
Yeah, I coded a class derived from a class exported by that dll. I have the header files, but not the lib file.
I have to get a pointer to this static member variable, but without the DATA tag the linker created a thunk function and gives me the pointer to that... but the symbol is a variable and no function which will cause a crash of my application!
Don't try it, just do it!
|
|
|
|
|
Alexander M. wrote: Yeah...
Doing so will result in a LNK2001 error. MSDN clearly states:
Functions declared with the static modifier by definition have file scope. Static variables have the same limitation. Trying to access any static variables from outside of the file in which they are declared can result in a LNK2001 error.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
It has to work, all other modules of that software do the same...
I mean I can do exactly the same thing will all other dlls (which have the same software design) when I have the LIB file for them.
So it has to be a problem of that LIB file. Are there special tools I can use to display the contents of a lib file or even to modify it?
Don't try it, just do it!
|
|
|
|
|
Anyone know of a reliable way in MFC to set a timer to the nearest millisecond.
WHen i get a signal, i would like start a timer.
When i get another signal, i would like to stop the timer.
|
|
|
|
|
First of all it depends on what the timer will be for... a "timer" would, for me, be a time that you want to wake up a program or in other way do something at a specific time but I'm not sure if that's what you wanna do? I get the feeling that you wanna measure the time between two signals?
|
|
|
|
|
Simply want to get the time to the nearest millisecond that it would take for a device to perform an operation.
So i get a signal when the operation has started.
So i will start a timer
Then i get a signal when the operation has ended
So will stop the timer.
The time will be fast and hence why i need it to the nearest millisecond
|
|
|
|
|
As said below, Windows itself will not allow you to make reliable measurements like that. So it comes down to how reliable measurements you really need, since Windows is built the way it is you might just as well end up in a scenario where you get the signal "Started" when the operation actually already has finished... go figure.
|
|
|
|
|
See here.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
If you want to calculate time elapsed between two events
then u can calculate it by getting system time when event get
and on another event again get another snap of the time and simply calculate the diference
hope this will help u
Knock out "T" from CAN'T
You 'CAN' if you think you 'CAN'
|
|
|
|
|
I need to pass the macro __FUNCTION__ to a constructor (it's for error handling) but that macro will not work on any compiler.
What I want to know is if there is a way of knowing if the macro is avaiable with pre-processor directives. Something like:
#ifdef SOMETHING
MyConstructor( int );
#else
MyConstructor( void );
#endif
Where SOMETHING is only defined if __FUNCTION__ is avaiable. Is this possible? If not, is there any other way?
Thanks in advance
hint_54
|
|
|
|