smpoojary
asked on
Modal dialog with Month Calendar(CMonthCalCtrl) :Error
hi all,
I have created Modal dialog with Month Calendar(CMonthCalCtrl). While retreiving date I am getting wrong result. My code is like this
void DlgCal::OnSelchangeMonthca lendar1(NM HDR* pNMHDR, LRESULT* pResult)
{
CTime ct;
m_Date.GetCurSel(ct);
int Day = ct.GetDay();
*pResult = 0;
}
I am checking Day value while dubugging, it is giving wrong answer.
Please clear my doubts
With warm regards
-Mahesh
I have created Modal dialog with Month Calendar(CMonthCalCtrl). While retreiving date I am getting wrong result. My code is like this
void DlgCal::OnSelchangeMonthca
{
CTime ct;
m_Date.GetCurSel(ct);
int Day = ct.GetDay();
*pResult = 0;
}
I am checking Day value while dubugging, it is giving wrong answer.
Please clear my doubts
With warm regards
-Mahesh
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
What is the result of GetCurSel (). Its return value is a BOOL which you don't check. If it returns 0 the function failed and you shouldn't expect any useful result in ct.
ASKER
hi AndyAinscow,
Very very thanks for AndyAinscow. Yes it is VC++ bug. I have used your code. Now my code is working. I am also greatful to SteH.
Please tell me AndyAinscow, now I have only 5 points. How can I increase my points without pay money.
smpoojary@yahoo.com
With warm regards.
-Mahesh
Very very thanks for AndyAinscow. Yes it is VC++ bug. I have used your code. Now my code is working. I am also greatful to SteH.
Please tell me AndyAinscow, now I have only 5 points. How can I increase my points without pay money.
smpoojary@yahoo.com
With warm regards.
-Mahesh
Two ways.
1) Keep coming here. (I think it is something like 5 pts per day you accumulate)
2) Answer some questions (in any thread at EE) <if you can get more than 3000 ? points per month you can even qualify for an unlimited supply of points for you to ask questions with>
1) Keep coming here. (I think it is something like 5 pts per day you accumulate)
2) Answer some questions (in any thread at EE) <if you can get more than 3000 ? points per month you can even qualify for an unlimited supply of points for you to ask questions with>
The limit is a bit higher. You qualify if you reach 10,000 points. And to continue to qualify you need to earn 3,000 points each month.
I'd forgotton the minimum requirement.
Don't forget it the total points, not specific to a topic area.
Don't forget it the total points, not specific to a topic area.
ASKER
Thanks for Everybody
hi AndyAinscow,
If I use COleDateTime instead of CMonthCalCtrl in the above question, please tell me what is the solution.
With warm regards.
-Mahesh
hi AndyAinscow,
If I use COleDateTime instead of CMonthCalCtrl in the above question, please tell me what is the solution.
With warm regards.
-Mahesh
In the sample code I gave you the m_dteCurrent is a COleDateTime variable.
ASKER
hi AndyAinscow,
if 'm_ctlMonth' type is COleDateTime instead of CMonthCatCtrl, is there any solution. Otherwise two variables we have to create to use it.
With regards
-Mahesh
if 'm_ctlMonth' type is COleDateTime instead of CMonthCatCtrl, is there any solution. Otherwise two variables we have to create to use it.
With regards
-Mahesh
COleDateTime is a 'wrapper class' for a variable - NO USER INTERFACE. CMonthCalCtrl is a window based user interface for the user to select a date. Two completely different things.
There is a CDateTimeCtrl however - is that what you meant?
ASKER
hi AndyAinscow,
Thanks a lot.
With warm regards.
-Mahesh
Thanks a lot.
With warm regards.
-Mahesh
ASKER
Thanks for SteH also.
With warm regards
-Mahesh
With warm regards
-Mahesh