LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to get what day from ActiveX calendar control

Hi All,


I am using an ActiveX calendar control. When user click it, I want to know what day it is, Monday, Tuesday,.......Sunday.  Anyway to do it?

Thanks a lot for any help.



Anne
0 Kudos
Message 1 of 12
(3,043 Views)
You need to register a VI to be used as a callback. If you open the Example Finder (Help -> Find Examples), and search for "ActiveX" there's a couple of examples on how to register callback VIs. The attached example is something to get you started. It includes the callback so you can see how to access the control's properties and use those to figure out the day of the week. You'll need to use the selected day to figure that out. I've gotten you started on it - I'm sure you can finish the numerical calculations. Smiley Wink
Download All
0 Kudos
Message 2 of 12
(3,023 Views)
Hi Smercucio. I tried to help Anne Zuo as well but you were faster. In addition I still cannot wire the callback VI. I use Microsoft Month view control 6.0. I made the VI reentrant and strictly typedef. So why the hell I still cannot wire it? Thanks Message Edited by ceties on 05-28-2008 04:01 PM

Message Edited by ceties on 05-28-2008 04:02 PM
LV 2011, Win7
Download All
0 Kudos
Message 3 of 12
(3,016 Views)
It's because your event data and ctlref are not correct.  On the Reg Event node in Calender_cet.vi, right-click on VI Ref and select create callback VI.
Message 4 of 12
(3,009 Views)
Ouch! I didn't know that the VI is generated automatically. So thx!
LV 2011, Win7
Download All
0 Kudos
Message 5 of 12
(3,003 Views)
Thanks a lot for your help, but I still couldn't get it.


Click on 1st day of any month, any year, the result will be same:

Day:1; FirstDay:2;Quotient:0;Remainder:1


and apparently they are different day of week. 


Some trick I miss?

Thanks.

Anne



0 Kudos
Message 6 of 12
(2,995 Views)
Try this
LV 2011, Win7
Download All
0 Kudos
Message 7 of 12
(2,979 Views)
The "trick" is that the code isn't finished, as I explained, and indicated in the callback VI. The callback VI is always picking "Sunday". I was showing you how to use a callback to get the calendar values when you click on a date, which is what you need to do. As for calculating the day of the week you can try to figure out how to do it from the "day", "month", "year", etc. or you can use the technique found in HOW TO MENTALLY CALCULATE THE DAY OF THE WEEK FOR ANY DATE. Smiley Wink


Message Edited by smercurio_fc on 05-28-2008 05:00 PM
0 Kudos
Message 8 of 12
(2,976 Views)
I'd like to try, but maybe I don't have that control and it tells me "Control couldn't be loaded". 

Smiley Sad



Anne



0 Kudos
Message 9 of 12
(2,972 Views)
I should really go and sleep. I renamed it that was the problem. So once again and properly
EDIT: For some reason during the upload the system adds "1" to the names. SO just rename "CallReg_v31.vi" to "CallReg_v3.vi" Or you just don't have this Active X.

Message Edited by ceties on 05-28-2008 05:12 PM
LV 2011, Win7
Download All
0 Kudos
Message 10 of 12
(2,970 Views)