|
Hi All,
I can find a few tools for doing this in JAVA
But nothing for doing it in C++
AnyOne know of any viable tools ?
Regardz
Colin Davies
|
|
|
|
|
Declaration : I am a beginner. (like C, always declare first )
Alright, straight to the point. I created a new MFC project,
dialog base. I have a main dialog with a button, which
will call the second dialog with a timer (clock).
Normally when I have single dialog, I start the timer by initializing it in OnInitDialog(). Now I have the time
in second dialog, where should i initialize it?
In which function? Or what should I do?
Any opinion is extremely welcome. Thanks.
|
|
|
|
|
You want a timer to initialise when the button is pushed to wait for the dialog, or when the dialog comes up to do something else ? If the former, start the timer when the button is pushed, if the latter, in OnInitDialog of dialog 2.
|
|
|
|
|
I would like the timer to start when the button on the
first dialog is pushed. So when the second dialog pop up
it has a running clock.....
|
|
|
|
|
Declaration : I am a beginner. (like C, always declare first )
Alright, straight to the point. I created a new MFC project,
dialog base. I have a main dialog with a button, which
will call the second dialog with a timer (clock).
Normally when I have single dialog, I start the timer by initializing it in OnInitDialog(). Now I have the time
in second dialog, where should i initialize it?
In which function? Or what should I do?
Any opinion is extremely welcome. Thanks.
|
|
|
|
|
Anybody know how to write modules to Flight Simulator 2000????
If you know please contact with me on this email:
piopawlu@interia.pl
|
|
|
|
|
|
Is it possible to have a timer in the background of a console-based program? Maybe an API function that takes a pointer to a function in my program?
I would be very happy if it could even operate in the background of a prompt for text input.
The reason for this question, is that I am developing a text-based adventure game (Yes, it IS true), and I want it to be real-time.
Thanks in Advance.
Ulf
|
|
|
|
|
You can't use the Windows WM_TIMER message without a window. (this includes the callback function variation, which simply translates the window message to a callback).
There are several solutions to this.
1) Create a hidden window to recieve the messages
2) Use the Sleep() function to sleep for the amount of time that you would want to use a timer for. This has the drawback of blocking until the time is up.
3) Use a multimedia timer.
|
|
|
|
|
What I have to do to retrieve the text of a DOS program while it runs and show the text in a TextBox Control for example? In other words, how I can monitor the output of a DOS program? Thanx.
|
|
|
|
|
when I include the afxpriv.h file (doesn't matter which file its included in)
I get the following messages after compiling:
..\include\afxpriv.h(640) : error C2259: 'CDockBar' : cannot instantiate abstract class due to following members:
..\include\afxpriv.h(565) : see declaration of 'CDockBar'
..\include\afxpriv.h(640) : warning C4259: 'void __thiscall CControlBar::OnUpdateCmdUI(class CFrameWnd *,int)' : pure virtual function was not defined
..\include\afxext.h(165) : see declaration of 'OnUpdateCmdUI'
The reason I want to include this file is to use the CControlBar.
How do i include this file without getting these error ??
Thanks
|
|
|
|
|
Why do you think you need to include that file to use CControlBars? I have never needed to included it.
What exactly are you up to?
Roger C.
|
|
|
|
|
Oh... I see, it's used in the CtrlBars sample. I'm not clear as to the error messages... I'll take another look.
|
|
|
|
|
afxpriv.h is not intended to be used by user programs, but it's there as an "If you insist, but we don't support this" kind of thing.
Generally this code means that OnUpdateCmdUI is a pure virtual function which cannot be sued by itself, you must inherit from it and specify your own OnUpdateCmdUI function.
|
|
|
|
|
CControlBar is an abstract class. I am trying to understand what you are doing and I get the feeling you are tying to create a CControlBar object.
|
|
|
|
|
Roger and Erik above are right. CControlBar is an abstract class (has abstract member functions) and you can't instantiate an object from it. You should derive your own class from CControlBar (say CMyBar) and provide your implementation of the virtual function.
You can define OnUpdateCmdUI() as a do-nothing function in your class.
Take a look at my code here: http://www.codeproject.com/docking/sizecbar.asp
If you are patient, you will see that CSizingControlBar is derived directly from CControlBar, and it provides its own OnUpdateCmdUI().
|
|
|
|
|
Is it possible to pass a parameter of type void * in a DCOM interface? If not, is there a way around passing data structures via address where the type is not specified?
|
|
|
|
|
Hi Gurus,
How to get control panel object? Actually i want to add a atb control
to control panel / display properties, Can any body tell me how to proceed?
I think it is possible by getting control pnel object from that by getting
Display properties object, then only there is a chance of adding a tab control
to diaplay properties.
Is there any possibility to get control panel's object through Ishellbrowse,
IShellview etc.
If anybody have an idea, send me links or articles.
Thanks in advance,
Koteswara
|
|
|
|
|
I've tried to store the windows location/size in the registry, and it appears to save the right numbers, but when I read them back in and call MoveWindow it seems to change the numbers. Is move window the right function to call for this, or am I saving the wrong postion using by calling GetWindowRect? I'm pretty sure that its not any of the code that is wrong, but rather that I'm not saving the right numbers.
thanks tyler.
|
|
|
|
|
There are a few possible issues.
1/ Where are you setting the position
2/ what sort of co-ordinates are you saving ( relative to window or relative to dialog ) ? ClientToScreen will convert your co-ordinates to ones relative to the whole window
3/ Have you checked the values going in and coming out to make sure you're reading them correctly ?
4/ Are you passing them in correctly ( MoveWindow takes a width and height, rather than x2, y2. )
|
|
|
|
|
ah yeah, MoveWindow takes width and height and not x2, y2.
I wish I remembered that.
I did this once in MFC though the same way with MoveWindow using GetWindowRect but when looking back through the code I missed the rect.Width(), and rect.Height() instead of just a RECT structure passing the bottom and right.
thanks for the help.
|
|
|
|
|
You may also try with Get/SetWindowPlacement() .
If you save and restore all its fields you can also restore minimized/maximized state.
Cheers
Paolo.
|
|
|
|
|
I suggest that you should read the topic about Persistent Frames in the book Inside Visual C++ from Kruglinsky from Microsoft Press.
|
|
|
|
|
to save the Window position :
WINDOWPLACEMENT pwp;
BOOL ret;
ret = GetWindowPlacement(&pwp);
CString strBuffer;
strBuffer.Format("%i %i %i %i %i %i %i %i %i %i",
pwp.flags, pwp.showCmd,
pwp.ptMinPosition.x , pwp.ptMinPosition.y ,
pwp.ptMaxPosition.x , pwp.ptMaxPosition.y ,
pwp.rcNormalPosition.left , pwp.rcNormalPosition.top ,
pwp.rcNormalPosition.right , pwp.rcNormalPosition.bottom);
AfxGetApp()->WriteProfileString("Settings","windowPos",strBuffer);
to restore the window position :
WINDOWPLACEMENT pwp;
CString strBuffer = AfxGetApp ()->GetProfileString("Settings","windowPos");
int cRead = _stscanf(strBuffer,"%i %i %i %i %i %i %i %i %i %i",
&pwp.flags,&pwp.showCmd,
&pwp.ptMinPosition.x , &pwp.ptMinPosition.y ,
&pwp.ptMaxPosition.x , &pwp.ptMaxPosition.y ,
&pwp.rcNormalPosition.left , &pwp.rcNormalPosition.top ,
&pwp.rcNormalPosition.right , &pwp.rcNormalPosition.bottom);
if (cRead == 10) SetWindowPlacement(&pwp);
|
|
|
|
|
thanks a lot, this is much better than what I was doing previously.
|
|
|
|