|
You can't. Although the documentation suggests otherwise, it does not work in Windows XP.
Use the best guess
|
|
|
|
|
how can I do this with any other method
|
|
|
|
|
|
Can you change the icon to bitmap and try CBitmapButton class to load it on the button?
You talk about Being HUMAN. I have it in my name
AnsHUMAN
|
|
|
|
|
Hi, I have a global variable, in one thread, it be updated with new value, another thread read the variable.
Now I want to synchronized the 2 thread, that means, when it is updating in thread 1, then thread 2 have to wait to read it.
I wonder what synchronization method to use.
|
|
|
|
|
Solved, I use a AutoResetEvent now
|
|
|
|
|
If you do this more than once during the lifetime of your worker thread then this isn't enough.
|
|
|
|
|
You must use a critical section.
|
|
|
|
|
yes, later I turn to critical section, user mode synchronization way
|
|
|
|
|
hey,
i m very new to programming . could u pls help me with this isssue,
i have to read abt 300 files of the format 4 letter word followed by 4 digits "." 2 digits and 1 alphabet
|
|
|
|
|
hmgm wrote: help me with this isssue
You would need to explain exactly how that is an issue to begin with.
|
|
|
|
|
oh look, another indian pretending to be an american so he can get his code written for him.
==============================
Nothing to say.
modified 26-Jun-13 7:21am.
|
|
|
|
|
|
So show us what you've put together so far (relevant code only), and explain in detail what problem(s) you are having. Anything short of that and you're barking up the wrong tree.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
Hello
I wanted to log the value of a variable at all times. In fact I want to log the value of the variable every time its value changes. I searched but I didn't find what I wanted. I appreciate your answers.
Thanks in advance
modified 26-Jun-13 5:34am.
|
|
|
|
|
I think I understand your problem;
You will definately have to log the variable value every time it changes - AFAIK there is no way of doing this 'automatically'.
The easiest way to log is probably to write the variable value into the stdout stream:
int main(void){
int myVariable = 0;
cout<<"myVariable has the value "<<myVariable;
myVariable = 345;
cout<<"myVariable has the value "<<myVariable;
return 0;
}
However, if you want to log the value outside of the IDE and are not developing a console app, you would need to write it to a file[^].
cheers,
Marco
|
|
|
|
|
Traditional "inline" logging always comes handy, but I was wondering maybe there could be a way to do it more precisely and automatically. Since there are many statements changing the value of the variable, this won't be a practical solution.
Thank you
|
|
|
|
|
ErfanNoury wrote: Since there are many statements changing the value of the variable, this won't be a practical solution.
I thought that you were thinking about something like that - The most important precondition is that you know when a variable value changes.
It is impossible to find this out when the variable of type char, int or any other native type.
The easiest way would probably be to encapsulate the variable with a setter where you can reckon that the value has changed:
int main(void){
int myVariable;
SetMyVariable(myVariable, 0);
SetMyVariable(myVariable, 345);
return 0;
}
void SetMyVariable(int variable, value){
variable = value;
cout<<"myVariable has the value "<< value;
return;
}
|
|
|
|
|
Yeah it's a good idea! I think it is better to wrap the variable into a class and through operator overloading I can log the value of the variable whenever it changes.
|
|
|
|
|
Yes, that's fine. Probably you want to do that just in the debug build.
Veni, vidi, vici.
|
|
|
|
|
According to MSDN, timeSetEvent() run in its own thread, then call timeSetEvent(), when the callback of the timeSetEvent be invoked is undetermined, not like system.threading.timer(), it has a due time to start. right?
|
|
|
|
|
econy wrote: ...the callback of the timeSetEvent be invoked is undetermined... The callback function is called once upon expiration of a single event, or periodically upon expiration of periodic events. That sounds deterministic to me.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
I mean, when is it start to count in a new thread?
OS decide which thread to start, right?
|
|
|
|
|
econy wrote: I mean, when is it start to count in a new thread? When timeSetEvent() returns, I presume.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
Hi I am new in c++. Recently I am converting a C++ project to Visual Studio 10 c++ . I am getting an error.
error C2664:
The code is:
XNodes::iterator _tagXMLNode::GetChildIterator( LPXNode node )
{
XNodes::iterator it = childs.begin();
for( ; it != childs.end() ; ++(it) )
{
if( *it == node )
return it;
}
return NULL;
}
How to fix it?
Thanks in advance,
Sai
|
|
|
|