|
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
|
|
|
|
|
hint_54 wrote: ...if __FUNCTION__ is avaiable.
Can't you just use:
#ifdef __FUNCTION__
...
#endif
"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 dont know. I dont have the means to test it. My compiler (VS6) does not support the __FUNCTION__ macro. You think it will work?
regards
hint_54
|
|
|
|
|
|
What about the compilers that are not from microsoft?
regards
hint_54
|
|
|
|
|
|
true
hint_54
|
|
|
|
|
hi
i wana program in mfc that read from text file and do it an lexical analysis in compiler stage put the integer in list & key word in list & operation in list & real number in list & constant in list and punctuation in list
if any one can help send me email and i will send him the ER diagram
|
|
|
|
|
Hi,
i might misread you but if i'am right you would like to write some kind of lexical analysis in mfc, don't you?
Well i can't serve with an mfc lexical analysis but during my studies i had to program a compiler for a so called language pl/0, which is kind of a pascal dialect. My solution does a lexical & syntax analysis and even produces code for a small virtual machine. It is all written in C, but really straight forward and perhaps useful for you.
If this isn't exactly what you have been looking for, then just ignore my reply.
http://www.htw-dresden.de/~s7725/study/compiler/pl0_extended_s7725.tar.gz[^]
have a nice day
|
|
|
|