|
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]
|
|
|
|
|
I have already installed DirectX 9.0 on my system.
Pravin
|
|
|
|
|
DirectX runtime and DirectX SDK (Software Development Kit) are two quite different things.
Are you sure you have the SDK installed?
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]
|
|
|
|
|
yes i sure that i have installed DirectX SDK 9.0
Pravin
|
|
|
|
|
It seems you have to build it
[^].
Anyway the page is rather old, I don't know if things changed since then.
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]
|
|
|
|
|
yes i did it, but still facing same problem...
Pravin
|
|
|
|
|
If you've built it then you now have it. Change your IDE settings to make it aware of the library presence.
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]
|
|
|
|