|
e-DJ wrote: So I can not singlestep through my application to find the error.
u can do debuging in a release version too
set the following option in project settings
take project->Setting
now take c++ tab
in the optimization combobox select Disabled
in the Debug info combo select "Program database for edit and continue"
now take the Link tab
Tick the check box "Generate debug info"
now rebuild the project
nave
|
|
|
|
|
Hi
I have a property sheet with tabbed property pages
When the property sheet is opened up, depending on some user settings some pages
are not displayed
When the property sheet is created, i add all the pages
the in OnInitDaig, i remove the pages i dont need with
RemovePage(&m_Page1);
this works fine, if i only open the sheet up once
If i try to open again, i get an expection error on RemovePage line, it seems the second time around
the page doesnt exist, how can i check so that the second time the sheet is opened up it doesnt try to removepage which has already been removed
anyone any ideas
thanks
si
|
|
|
|
|
si_69 wrote: RemovePage(&m_Page1);
if(m_Page1)<br />
{<br />
RemovePage(&m_Page1);<br />
m_Page1=0;<br />
}<br />
and check m_Page1==0 before RemovePage API
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
A_Laxmanm_Page1=0;
i think m_Page1 is an object of class derived from CPropertyPage
in that case how can we assign like this?
nave
|
|
|
|
|
Naveen R wrote: in that case how can we assign like this?
Yeh, you are right..we can't
I think we can solve the problem by maintaining the flags for pages.
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
si_69 wrote: the in OnInitDaig
Where did u wrote the OnInitDialog()? .I mean in which dialog?
couldn't u keep some flags?
nave
|
|
|
|
|
si_69 wrote: When the property sheet is created, i add all the pages
the in OnInitDaig, i remove the pages i dont need with
RemovePage(&m_Page1);
I'm curious why you don't just call AddPage() for the pages you want added, rather than add them all and remove the unwanted ones.
si_69 wrote: this works fine, if i only open the sheet up once
If i try to open again,
Does the sheet get closed or hidden? How does it get re-opened?
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Trying to compare a date to see if it is earlier of later.
My CompareFileTime function returns junk.. 0xffffff.
FILETIME Time;
SYSTEMTIME stime;
FILETIME ftime;
GetSystemTime(&stime);
BOOL bSys = SystemTimeToFileTime(&stime, &ftime);
LONG lfiletime;
FileTimeToLocalFileTime(&FindFileData.ftCreationTime,&Time);
//Time = &FindFileData.ftCreationTime;
lfiletime = CompareFileTime(&Time, &ftime);
|
|
|
|
|
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_
|
|
|
|