|
Create a statusbar pane (eg: with id IDC_CLOCK_PANE ) and write a ON_UPDATE_COMMAND_UI handler for it which sets the pane's text to the current time.
void CMainFrame::OnUpdateClockPane
(CCmdUI* pCmdUI)
{
ASSERT (NULL != pCmdUI);
pCmdUI->SetText (CTime::GetCurrentTime().Format(_T("...")));
} Oh wait - you're not using MFC. In that case, you could create a one second timer (actually slightly less than 1 sec) and update the main window's status bar's pane within the handler for WM_TIMER .
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Well the thing is, I dont know how to make the clock appear on my window. I was wondering if anyone knew how to do that. I dont know how to create it at all.
|
|
|
|
|
I think Nishant's status bar article is what you are looking for, with a little modification for your needs.
http://www.codeproject.com/statusbar/dlgstatbar01.asp
Since you want to show total running time, you can first record and store the initial time upon application's startup. And the on every OnTimer() function call, take the difference between the initial time and the current time and output on the status bar.
|
|
|
|
|
Hi,
Can anyone give me some pointer on how I can make some IE browser addons like Google toolbar/yahoo tollbar.
Thanks
|
|
|
|
|
A CodeProject search for "ie toolbar" will yield several examples.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Hi all...
(* long time no seen *)
For months and months I try to find out...
What is the formula behind the sinus,
because I want to do my own sinus function (Ex. double MySin(double) )
Please heeelp me...
Any kind of help will be greatly appreciated
=-=-=-=-=-=-=
The Server
|
|
|
|
|
|
Can someone tell me where I can find some good info, on packing structures and alignment. I have never quite understood the topic.
I have to pack some structures in my Windows application.
Thanks.
Jerry
|
|
|
|
|
Start with the #pragma pack() directive.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
|
Hai,
I'm using win32 vc++. I'm drawing the background for my button by subclassing.
But at no. of times I'm enabling and disabling the button in my dialog procedure(not in subclass proc). At those times how can I display the text in button as grey ie. how can I retrieve the text from the button and grey it?
Thanks a lot.
|
|
|
|
|
Does GetWindowText work??
"Fish and guests stink in three days." - Benjamin Franlkin
|
|
|
|
|
hai,
GetWindowText did'nt work. It's getting the caption of the button which there is none cause i'm displaying the text of the button using DrawText() inside the subclass procedure.
anyway thanks.
|
|
|
|
|
In that case, you should store a copy of the text displayed in a member variable inside the subclass. Then override the GetWindowText function (or define an other) that gives you acces to the caption of the button.
A student knows little about a lot.
A professor knows a lot about little.
I know everything about nothing.
|
|
|
|
|
Hi,
I have a device driver for a USB device written in VC++.There is a function in it to Read /write data to the USB port.Now I want to write a a function in C++ so that users can write programs in C++ rather in VC++.
Since c++ doesnt recognise data types like DWORD,BUFFER etc..I am struck.
Is there anyway i can link C++ and VC++.Can i use pointers.
thanks
nev.
|
|
|
|
|
naveen_vi wrote:
Since c++ doesnt recognise data types like DWORD
From WinDef.h
typedef unsigned long DWORD;
naveen_vi wrote:
Is there anyway i can link C++ and VC++.Can i use pointers.
"No matter where you go, there your are." - Buckaroo Banzai
-pete
|
|
|
|
|
Hi,
Thanks for ur reply.
So is it enough to include windef.h in my C++ program and write my own header file.
so with typdef can i convert all windows data and use them in my C++ file.
nev
|
|
|
|
|
nev, i don't want to insult you but this is all beginner C++ issues. You should probably take the time to study these basic language concepts so that you understand them before you attempt to implement your project.
But, that's just my opinion... I could be wrong.
"No matter where you go, there your are." - Buckaroo Banzai
-pete
|
|
|
|
|
|
hi mike,
I have a USB chip.They have given me the device driver and thier function looks like this.
http://www.ftdichip.com/knowledgebase/d2xx/manual/userguide.htm
write function is:
FT_STATUS FT_Write ( FT_HANDLE ftHandle, LPVOID lpBuffer, DWORD dwBytesToWrite, LPDWORD lpdwBytesWritten ) .They actually imported functions from win32 api(kernell32.dll).
where FT_status is ULONG data type.
http://www.ftdichip.com/knowledgebase/d2xx/manual/userguide.htm
If i just want to write a C++ program to write my data into LPVOID lpbuffer.How do i di it.I want my function to look like
write(int addr,unsigned char data);
nev
|
|
|
|
|
Helloo sir,with all due respect,
could you give me useful pointer over smartcard api's
thanks
-----------------------------
"I Think It will Work"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
Alok the programmer wrote:
could you give me useful pointer over smartcard api's
What kind of API. Are you talking about a smart card reader or the API of the card itself. The API's usually depend on the hardware being used to read the cards. Google is your best friend in these matters unless you know the manufacturer of your hardware/card.
Michael
CP Blog [^]
|
|
|
|
|
naveen_vi wrote:
Since c++ doesnt recognise data types like DWORD,BUFFER etc..I am struck.
DWORD, BUFFER etc are all Windows types. If you are writing a Windows application then these will be available in any C++ compiler. Most of these are defined in WINDEFS.H and map to standard C++ types.
Your question is a little vague. More information would allow us to help you better.
Michael
CP Blog [^]
|
|
|
|
|
Hi Everybody,
I would like to know how to find a substring in a string. finding should be done without case sensitive.
for example consider a string HomeWork.
I want to search wheather worK is there in the above string.
Let me know any function that perform this type of searching.
I tried strstr(), but it did not work because it is case sensitive.
Thanks in Advance.
|
|
|
|
|