[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Modal dialog with Month Calendar(CMonthCalCtrl) :Error

Posted on 2004-09-09
13
Medium Priority
?
395 Views
Last Modified: 2013-11-20
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::OnSelchangeMonthcalendar1(NMHDR* 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
0
Comment
Question by:smpoojary
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 5
  • 2
13 Comments
 
LVL 45

Accepted Solution

by:
AndyAinscow earned 180 total points
ID: 12024430
I think there might be a problem in the monthcal control itself.

This is from an app

      SYSTEMTIME sysTime;
      if(m_ctlMonth.SendMessage(MCM_GETCURSEL, 0, (LPARAM) &sysTime))
            m_dteCurrent.SetDate(sysTime.wYear, sysTime.wMonth, sysTime.wDay);


the sysTime.wDay should be the day
0
 
LVL 13

Expert Comment

by:SteH
ID: 12024452
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.
0
 
LVL 4

Author Comment

by:smpoojary
ID: 12025116
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
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 45

Expert Comment

by:AndyAinscow
ID: 12025337
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>
0
 
LVL 13

Expert Comment

by:SteH
ID: 12025608
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.
0
 
LVL 45

Expert Comment

by:AndyAinscow
ID: 12025830
I'd forgotton the minimum requirement.
Don't forget it the total points, not specific to a topic area.
0
 
LVL 4

Author Comment

by:smpoojary
ID: 12061606
                                                                 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

     

0
 
LVL 45

Expert Comment

by:AndyAinscow
ID: 12062149
In the sample code I gave you the m_dteCurrent is a COleDateTime variable.
0
 
LVL 4

Author Comment

by:smpoojary
ID: 12062345
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
0
 
LVL 45

Expert Comment

by:AndyAinscow
ID: 12062468
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.
0
 
LVL 45

Expert Comment

by:AndyAinscow
ID: 12062559
There is a CDateTimeCtrl however - is that what you meant?
0
 
LVL 4

Author Comment

by:smpoojary
ID: 12063186
hi AndyAinscow,

     Thanks a lot.
     With warm regards.
     -Mahesh

     
0
 
LVL 4

Author Comment

by:smpoojary
ID: 12063194
Thanks for SteH also.
With warm regards
-Mahesh
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
In this post we will learn different types of Android Layout and some basics of an Android App.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question