Independentsoft
Professional software libraries for developers
Home
Purchase
Support
Company
Contact
MSG C++
>
Tutorial
> Create task
The following example shows you how to create a task.
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 task; task.set_message_class(u"IPM.Task"); task.set_subject(u"Test"); task.set_body(u"Body text"); task.set_owner(u"John"); task.set_task_status(TaskStatus::NotStarted); task.set_priority(Priority::High); std::time_t now = std::time(nullptr); task.set_task_start_date(to_filetime(now + 86400)); // tomorrow task.set_task_due_date(to_filetime(now + 5 * 86400)); // in 5 days task.save("c:/temp/task.msg", true); return 0; }
Need help? Ask our developers:
Name*
Email*
Message*