Independentsoft
Professional software libraries for developers
Home
Purchase
Support
Company
Contact
MSG C++
>
Tutorial
> Create appointment
The following example shows you how to create an appointment.
C++ example
#include
#include "independentsoft/msg/message.hpp" using namespace independentsoft::msg; // Convert std::time_t to FILETIME (100-ns ticks since 1601-01-01) int64_t to_filetime(std::time_t t) { return (static_cast
(t) + 11644473600LL) * 10000000LL; } int main() { Message appointment; appointment.set_message_class(u"IPM.Appointment"); appointment.set_subject(u"Test"); appointment.set_body(u"Body text"); appointment.set_location(u"My Office"); std::time_t now = std::time(nullptr); struct tm today = *std::localtime(&now); today.tm_hour = 16; today.tm_min = 0; today.tm_sec = 0; appointment.set_appointment_start_time(to_filetime(std::mktime(&today))); today.tm_hour = 17; appointment.set_appointment_end_time(to_filetime(std::mktime(&today))); appointment.save("c:/temp/appointment.msg", true); return 0; }
Need help? Ask our developers:
Name*
Email*
Message*