|
So and So wrote:
Columns t_Columns[45];
.
.
t_Columns[i] = new Columns();
Your t_Columns is an array of Columns objects so you can't 'new' it. It is already created.
So and So wrote:
Columns * t_Columns[45];
.
.
*(t_Columns + i) = new Columns();
Now you can 'new' it but you should write it as:
t_Columns[i] = new Columns();
<font=arial>Weiye Chen
When pursuing your dreams, don't forget to enjoy your life...
|
|
|
|
|
Hi everyone, I'm working on this program for work,and Im trying to create a clock at the bottom right hand side of the screen in a status bar so it shows the user how long theyhave been using the program. the clock should work like this. First when the user first starts the program the clock will be at 00:00:00, and then 1 second later itll be at 00:00:01, and then two seconds later itll be at 00:00:02, and so on. Ive been looking everywhere on the net, but I havent been able to find anything. Im coding in C++ and using Win32 programming NOT the MFC's.
if u have an answer for me, email me at osalman@csulb.edu. or just reply here. Thank you all for your time!
|
|
|
|
|
I dont know how to put the time at the status bar, but time since process started can be found by clock() function
http://www.cplusplus.com/ref/ctime/clock.html
|
|
|
|
|
Well the code that was there are all for a windows console program. Im trying to make a Win32 GUI program. My clock should work like a clock on a MIDI program in the sense the user can see the seconds going by and what not. Do you have any examples of that.
Thanks for all your help.
|
|
|
|
|
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
|
|
|
|