|
CPallini wrote: RPC?
naah i like WM_COPYDATA more!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You/xml>
|
|
|
|
|
Look at this (it is not specifically for MFC).
However if you do not need a high precision timer (like multimedia ones), you can use SetTimer of CWnd and handle the event fired overriding the OnTimer virtual function (or handle the WM_TIMER explicitly).
|
|
|
|
|
Although many people do suggest using the CTimer class See Here)[^]
The SetTimer function and related message and functions are not intended to be precise. Certainly you need to at least use more precise timers. Note that, except for special versions of Windows, Windows is not designed for real-time processing. Don't expect an application program to be able to respond reliably to timer events.
I would suggest you to read this[^] before you implement anything
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Well, for a ten seconds timer, I suppose real-time system timing precision is not required.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
BTW and IMO it was not a bad piece of information (to be voted down to 1), Sometimes you really need accurate timers and many a times you may not. Things look weird when you come to know that your timer is not getting fired every ten seconds and you want it to behave like that and that too after spending a lot of time in debugging.
After all it was only a piece of advise.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
_AnShUmAn_ wrote: BTW and IMO it was not a bad piece of information
I agree: it is indeed a valuable piece of information. I simply added a common sense based observation.
_AnShUmAn_ wrote: to be voted down to 1
I've just balanced the troll's vote.
Cheers,
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
CPallini wrote: I've just balanced the troll's vote.
I am in too!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You/xml>
|
|
|
|
|
_AnShUmAn_ wrote: BTW and IMO it was not a bad piece of information (to be voted down to 1),
Not at all, let me square it of too.. the person who voted you down.. must be A** !
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You/xml>
|
|
|
|
|
hi,
i want to ask a simple question related to my code here. I am using a MessageBox to show the user the estimated time of the battery. The start value is an ULONG which i put into my function as float seconds. The cond param is the returnstring of my function.
Is the conversion (because the wsprintf function does not understand the %f param for formatting) right ? And what could i improve ?
Thanks !
void gettimestring(float seconds,wchar_t *input)
{
float minutes,hours;
hours = floorf(seconds/3600);
seconds -= hours*3600;
minutes = floorf(seconds/60);
seconds -= minutes*60;
char buf[20];
sprintf(buf,"%02.0f:%02.0f:%02.0f",hours,minutes,seconds);
wsprintf(input,L"%S",buf);
}
bye,
gabbana
|
|
|
|
|
Try Win32 API "MultiByteToWideChar"
For example
int nSize = MultiByteToWideChar(CP_ACP,MB_PRECOMPOSED,buf,strlen(buf),input,sizeof(input));
input[nSize] = 0;
|
|
|
|
|
Okay thanks i will try it, i think i need first to look into the msdn what the params exactly mean.
|
|
|
|
|
Why are you using float s for such a thing?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
The calcucaltion of the hours have decimal numbers. So I think i need floats at minimum or what do you mean exactly ?
|
|
|
|
|
I mean, for instance
7305 seconds = 2 hours, 1 minute, 42 seconds
for such a conversion floats are not needed:
int iTotSecs = 7305;
int iHours, iMins, iSecs;
iHours = iTotSecs / 3600;
iMins = (iTotSecs % 3600) / 60;
iSecs = iTotSecs % 60;
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
ohh yes that's right, but if i could remember the compiler put out some warnings and this was it i want to avoid.
|
|
|
|
|
To eliminate all the warnings a simple cast on the original variable is enough.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
gabbana wrote: The calcucaltion of the hours have decimal numbers.
So then use a double .
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
gabbana wrote: char buf[20]; sprintf(buf,"%02.0f:%02.0f:%02.0f",hours,minutes,seconds); wsprintf(input,L"%S",buf);
Instead of using char memory to variable buf, why don't you simply allocate the memory to wchar!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You/xml>
|
|
|
|
|
I wish to create an editor with a Docked Toolbar, which can be dragged to make it a Floating Toolbar. When user will drag the Floating Toolbar to the Top/Right/Bottom/Left border of the editor, it should be Docked to that border area of the editor.
This phenomenon is too common in various editors we use. How to create this effect in WIN32?? Is there any API or toolbar-property or any standard approch to enable a toolbar to provide this Docking-Floating Effect, sensing the mouse drag??
Can anyone help me out??
|
|
|
|
|
Many companies in the world have what is either a real or a virtual monopoly - 2 products that may spring to mind immediately as being subjects of this monopoly are mp3 players & pc operating systems.
Search Engines, however are reasonably abundant. You may have noticed already that even our beloved Code Project has one. If you type "Docking Toolbar win32" into CP's, you'll find two pages of them.
Here: http://www.codeproject.com/info/search.aspx?artkw=Docking+Toolbar+win32&sbo=kw[^]
|
|
|
|
|
Hi all,
I m using a TreeCtrl in FormView,I want to perform an action on LbuttonDoubleclick and Enter key of keyboard.
i m using those function,
ON_WM_KEYDOWN();
ON_WM_LBUTTONDBLCLK();
NM_DBLCLK on treectrl;
TVN_KEYDOWN on treectrl;
but its not working,may be i m using wrong method please help me for this.
Please tell me how can i do this.
Which function is use for this please tell me with example.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
"_$h@nky_" wrote: but its not working
That is not helping us know what the problem is.
led mike
|
|
|
|
|
Tell me how can i get tree item on Ldutton doublr click and on pressing of Enter key.
Thanks.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
Hi,
I am new to VC++, I have a source code for decryption of video. it uses DirectX technology, Now I want to modify that program. But whenever i going to build it, it gives the following error messege...
fatal error LNK1181: cannot open input file 'C:\DXSDK\Samples\C++\DirectShow\BaseClasses\Debug_Unicode\strmbasd.lib'
I have installed the new version of DirectX on my machine. I tried to search that .lib file on my system, but i am not able to search it.
anybody can help me?
Pravin
|
|
|
|
|
pavya_Cool wrote: have installed the new version of DirectX on my machine.
Possibly you have to install the (latest) DirectX SDK [^].
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|