本文整理汇总了C++中TimeZone::WallTimeToUtcTime方法的典型用法代码示例。如果您正苦于以下问题:C++ TimeZone::WallTimeToUtcTime方法的具体用法?C++ TimeZone::WallTimeToUtcTime怎么用?C++ TimeZone::WallTimeToUtcTime使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TimeZone
的用法示例。
在下文中一共展示了TimeZone::WallTimeToUtcTime方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetErrorMessage
result
EditEventForm::UpdateEvent(void)
{
result r = E_SUCCESS;
// Sets the Subject
String strValue = __pSubjectEditField->GetText();
if (strValue.IsEmpty() == false)
{
__pCalEvent->SetSubject(strValue);
}
// Sets the Location
__pCalEvent->SetLocation(__pLocationEditField->GetText());
// Sets the Description
__pCalEvent->SetDescription(__pDescriptionEditField->GetText());
// Sets the Priority
__pCalEvent->SetPriority(__selectedPriority);
// Sets the Sensitivity
__pCalEvent->SetSensitivity(__selectedSensitivity);
// Sets the Status
__pCalEvent->SetStatus(__selectedStatus);
// Gets the Time zone.
LocaleManager localeManager;
localeManager.Construct();
TimeZone timeZone = localeManager.GetSystemTimeZone();
__pCalEvent->SetTimeZone(timeZone);
DateTime startDate;
DateTime endDate;
__pCalEvent->SetRecurrence(null);
if (__pIsAllDayButton->IsSelected() == true)
{
__pCalEvent->SetAllDayEvent(true);
startDate = __pStartEditDate->GetDate();
endDate = __pEndEditDate->GetDate();
endDate.AddDays(1);
__pCalEvent->SetStartAndEndTime(startDate, endDate);
}
else
{
__pCalEvent->SetAllDayEvent(false);
startDate.SetValue(__pStartEditDate->GetYear(), __pStartEditDate->GetMonth(), __pStartEditDate->GetDay(), __pStartEditTime->GetHour(), __pStartEditTime->GetMinute(), 0);
endDate.SetValue(__pEndEditDate->GetYear(), __pEndEditDate->GetMonth(), __pEndEditDate->GetDay(), __pEndEditTime->GetHour(), __pEndEditTime->GetMinute(), 0);
__pCalEvent->SetStartAndEndTime(timeZone.WallTimeToUtcTime(startDate), timeZone.WallTimeToUtcTime(endDate));
}
// Sets the Reminder
const IList& pReminderList = __pCalEvent->GetAllReminders();
if (pReminderList.GetCount() > 0)
{
__pCalEvent->RemoveReminderAt(0);
}
strValue = __pReminderEditField->GetText();
if (strValue.IsEmpty() == false)
{
int timeOffset = 0;
Integer::Parse(strValue, timeOffset);
if (timeOffset > 0)
{
Reminder reminder;
reminder.SetTimeOffset(__selectedReminder, timeOffset);
__pCalEvent->AddReminder(reminder);
}
}
// Sets the Recurrence
if (__pRecurrence != null)
{
const DateTime* pUntilDate = __pRecurrence->GetUntil();
if (pUntilDate && __pCalEvent->IsAllDayEvent() == false)
{
DateTime utcTime = timeZone.WallTimeToUtcTime(*pUntilDate);
__pRecurrence->SetUntil(&utcTime);
}
r = __pCalEvent->SetRecurrence(__pRecurrence);
TryCatch(!IsFailed(r), , "[%s] Failed to set recurrence to event.", GetErrorMessage(r));
}
r = __pCalendarbook->UpdateEvent(*__pCalEvent);
TryCatch(!IsFailed(r), , "[%s] Failed to update the event.", GetErrorMessage(r));
return r;
CATCH:
int doModal;
MessageBox messageBox;
messageBox.Construct(L"Error", "Failed to edit the event.", MSGBOX_STYLE_OK, 0);
messageBox.ShowAndWait(doModal);
//.........这里部分代码省略.........