|
0xFFFFFFFF is the same as -1 , and -1 is a valid return value from that function. Are you sure you are getting the wrong result?
Peace!
-=- James If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! DeleteFXPFiles & CheckFavorites (Please rate this post!)
|
|
|
|
|
Well, i check for -1, 1 or 1. In which case my algorithm totally misses the result. How would i catch it, would i have to check for 0Xffffff? Or does the computer know to equate that to -1?
|
|
|
|
|
0Xffffff is the hexadecimal representation of -1. So you can simply check for -1, this is exactly the same.
Cédric Moonen
Software developer
Charting control
|
|
|
|
|
Post the rest of the code that evaluates the result, as well as a step-by-step of what you see in the debugger as those lines are executed.
Peace!
-=- James If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! DeleteFXPFiles & CheckFavorites (Please rate this post!)
|
|
|
|
|
Did you saw MSDN for CompareFileTime
In MSDN
"Return Values
–1 indicates that the first file time is less than the second file time. 0 indicates that the first file time is equal to the second file time. +1 indicates that the first file time is greater than the second file time.
"
whitesky
|
|
|
|
|
I am displayiing a Dialog over a Dialog using
MyDlg->DispDialog.DoModal();
only the second Dialog (DispDialog) is displayed. How i can display both the Dialog same time. The Size of second Dialog is more than first Dialog.
|
|
|
|
|
If you only need to have your first dialog visible (without having to inject inputs), then you can simply use MoveWindow for the second dialog.
If it needs to receive user inputs, then you need to use modeless dialogs. You can have a look at this tutorial[^]
Cédric Moonen
Software developer
Charting control
|
|
|
|
|
anilksingh wrote: I am displayiing a Dialog over a Dialog using
MyDlg->DispDialog.DoModal();
only the second Dialog (DispDialog) is displayed. How i can display both the Dialog same time. The Size of second Dialog is more than first Dialog.
Create Modeless dialogs
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
Are you doing this on the click of OK button?
What happens to the first dialog? Does the dialog close or something else?
If you want both dialogs to show and respond to user inputs create Modeless dialog as A_Laxman and Cedric suggests.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
-- modified at 8:19 Wednesday 14th June, 2006
|
|
|
|
|
try like this
if( MyDlg->DispDialog.m_hWnd == 0 )
MyDlg->DispDialog.Create( ... )
MyDlg->DispDialog.ShowWindow( SW_SHOW );
MyDlg->DispDialog.DoModal();
nave
|
|
|
|
|
If you are displaying the dialog on click of another button the you can just do the DoModal() for another dialog and don't close the first one..
and If your dialog on top is covering first dialog then you can set the position of dialog by SetWindowPos.
If you Need to handle both the dialogs at same time you need to create them modeless
Cheers
"Peace of mind through Technology"
-- modified at 8:38 Wednesday 14th June, 2006
|
|
|
|
|
Hi,
I have to run two applications at a time.And I am having button in both application toolbar to switch between two applications.
i.e., If iam running first application,by pressing one button i switched to second apllication,but first appl has to in running mode.The samething has to be done in second application.
The process is same like that (Alt+Tab)in normal windows.
How can i do this?
|
|
|
|
|
the 2 application means????
Can u tel us is that 2 windows or dialogs etc...????
yours faithfully
ajeeshcv
|
|
|
|
|
Two different windows...
These two applcations are two different EXEs of vc++ program.
|
|
|
|
|
while pressing button of first window
pFirstWnd->ShowWindow( SW_HIDE );
pSecondWnd->ShowWindow( SW_SHOW );
::SetWindowPos( pSecondWnd->m_hWnd, HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE );
while pressing button of second window
pSecondWnd->ShowWindow( SW_HIDE );
pFirstWnd->ShowWindow( SW_SHOW );
::SetWindowPos( pFirstWnd->m_hWnd, HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE );
try this and tel the result
yours faithfully
ajeeshcv
|
|
|
|
|
The query actually was that there are two different exe's running and then you want to achieve alt+tab feature as in windows.
So how are you going to get the pointer (pSecond) in the first application and same for the other one.
Your code seems to work when you have two dialogs in the same application.
Isn't it ?
Correction:// And Cedric also mentioned this in his post
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
-- modified at 8:09 Wednesday 14th June, 2006
|
|
|
|
|
This is how I would try and do this.I haven't tried this myself :
hwnd is the handle to the other window . You can get it using the FindWindow API
Use SendMessage(hwnd,WM_ACTIVATE,0,0) to send message to the window when Alt+tab is pressed and even any of your window is activated.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
If that are 2 dialogs try this one.
while pressing button of first window
pFirstWnd->ShowWindow( SW_HIDE );
pSecondWnd->ShowWindow( SW_SHOW );
while pressing button of second window
pSecondWnd->ShowWindow( SW_HIDE );
pFirstWnd->ShowWindow( SW_SHOW );
yours faithfully
ajeeshcv
|
|
|
|
|
They are two different exe, so they don't share the same code.
Cédric Moonen
Software developer
Charting control
|
|
|
|
|
I searched about this in google,but i got the codings in VB.Its shows the same functionality what i want.
But i dont know wat to do in MFC.
http://www.thescarms.com/vbasic/alttab.asp[^]
These links tells what i need?
In this code it list out all running applications.But i dont want that.I will give aprticular application in the coding itself.
help me.
-- modified at 8:17 Wednesday 14th June, 2006
|
|
|
|
|
|
Now I know where my 1 went.
|
|
|
|
|
|
Sorry...
i missed the point that those windows are seperate process.
Then i think it will give great pleasure to me to call u teacher of processes and threads are for a Windows OS...........but only with ur permission....so can u????
yours faithfully
ajeeshcv
|
|
|
|
|
Use FindWindow or FindWindowEx API's for retreving the handle for another exe.
Cheers
"Peace of mind through Technology"
|
|
|
|