Index: build/winmainclientdll.sln =================================================================== --- build/winmainclientdll.sln (revision 84) +++ build/winmainclientdll.sln (working copy) @@ -1,6 +1,6 @@  -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual Studio 2005 +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual C++ Express 2008 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "OutlookDLL", "winmainclientdll.vcproj", "{7459AF2F-7B82-4153-B9E1-E4A71DC61821}" ProjectSection(ProjectDependencies) = postProject {D279EE74-36FB-4C4C-8F29-04947825C53E} = {D279EE74-36FB-4C4C-8F29-04947825C53E} Index: build/winmainclientdll.vcproj =================================================================== --- build/winmainclientdll.vcproj (revision 84) +++ build/winmainclientdll.vcproj (working copy) @@ -1,10 +1,11 @@ @@ -109,9 +112,6 @@ Name="VCAppVerifierTool" /> - @@ -184,6 +184,8 @@ IgnoreDefaultLibraryNames="LIBCD" ModuleDefinitionFile="..\src\cpp\winmaincpp.def" ProgramDatabaseFile=".\Release/winmainclientdll.pdb" + RandomizedBaseAddress="1" + DataExecutionPrevention="0" ImportLibrary=".\Release/winmainclientdll.lib" TargetMachine="1" /> @@ -208,9 +210,6 @@ Name="VCAppVerifierTool" /> - @@ -475,6 +474,10 @@ > + + Index: src/cpp/dataTransformer.cpp =================================================================== --- src/cpp/dataTransformer.cpp (revision 84) +++ src/cpp/dataTransformer.cpp (working copy) @@ -41,10 +41,12 @@ #include "vocl/WinContact.h" #include "vocl/WinEvent.h" +#include "vocl/WinRecipient.h" #include "vocl/WinTask.h" #include "vocl/WinNote.h" #include "vocl/WinContactSIF.h" #include "vocl/WinEventSIF.h" +#include "vocl/WinRecipientSIF.h" #include "vocl/WinTaskSIF.h" #include "vocl/WinNoteSIF.h" @@ -56,6 +58,8 @@ #include +#include "time.h" + using namespace std; @@ -114,7 +118,7 @@ else item = new WinContact(data); } else if (itemType == APPOINTMENT) { - if (useSIF) item = new WinEventSIF(data, sifFields, (const WCHAR**)recurrenceFields); + if (useSIF) item = new WinEventSIF(data, sifFields, (const WCHAR**)recurrenceFields, (const WCHAR**)attendeeFields); else item = new WinEvent(data); } else if (itemType == TASK) { @@ -236,6 +240,26 @@ } } } + // Attendees added + /* Do it the not so good way, for now */ + std::list recipientCollection = cApp->getRecipientCollection(); + std::list::iterator it; + for(it=recipientCollection.begin();it != recipientCollection.end();it++) { + ClientRecipient cRec = *it; + WinRecipient *recip; + if (useSIF) { + recip = new WinRecipientSIF(); + } else { + recip = new WinRecipient(); + } + recip->setAttendeeName(cRec.getName()); + recip->setAttendeeEmail(cRec.getAddress()); + if (useSIF) { + ((WinEventSIF *)winE)->addRecipient((WinRecipientSIF *)recip); + } else { + winE->addRecipient(recip); + } + } } else if (cItem->getType() == TASK) { @@ -332,7 +356,6 @@ */ int fillClientItem(const wstring& data, ClientItem* cItem, const wstring& itemType, const WCHAR* dataType) { - // If appointment, we clear the recurrence pattern (all fields are always sent). // Also appointment exceptions are removed here (if any). if (itemType == APPOINTMENT) { @@ -394,6 +417,14 @@ // Set events exceptions setRecurrenceExceptions(cItem, *(winE->getExcludeDates()), *(winE->getIncludeDates())); } + recipientList recipients = *winE->getRecipients(); + recipientList::iterator rit; + cApp->clearRecipients(); + for(rit=recipients.begin(); rit != recipients.end(); rit++) { + WinRecipient recip = *rit; + cApp->addAttendee(recip.getAttendeeName().c_str()); + } + cApp->resolveRecipients(); } else if (itemType == TASK) { @@ -418,7 +449,6 @@ if (winItem) { delete winItem; winItem = NULL; } - return 0; } Index: src/cpp/outlook/ClientApplication.cpp =================================================================== --- src/cpp/outlook/ClientApplication.cpp (revision 84) +++ src/cpp/outlook/ClientApplication.cpp (working copy) @@ -330,7 +330,6 @@ // Set the COM pointer to the internal folder (overwrite past values) folder->setCOMPtr(pFolder, itemType); - return folder; error: @@ -1270,4 +1269,4 @@ return true; -} \ No newline at end of file +} Index: src/cpp/outlook/ClientAppointment.cpp =================================================================== --- src/cpp/outlook/ClientAppointment.cpp (revision 84) +++ src/cpp/outlook/ClientAppointment.cpp (working copy) @@ -871,7 +871,40 @@ return cnew; } +std::list ClientAppointment::getRecipientCollection() { + std::list list; + // Iterate through the collection + + Redemption::ISafeRecipientsPtr recips = pSafeAppointment->GetRecipients(); + long recipientCount = recips->Count; + long l; + for (l=+1; lItem(l); + //recips.get_Item(*recip); + ClientRecipient *ctr = new ClientRecipient(); + ctr->setCOMPtr(recip); + list.push_back(*ctr); + } + return list; +} +void ClientAppointment::resolveRecipients() { + pSafeAppointment->GetRecipients()->ResolveAll(); + pAppointment->MeetingStatus = olMeeting; /* Tell Outlook we already 'sent' the + appointment */ +} +void ClientAppointment::addAttendee(const WCHAR* name) { + pSafeAppointment->GetRecipients()->Add(name); +} +void ClientAppointment::clearRecipients() { + Redemption::ISafeRecipientsPtr recips = pSafeAppointment->GetRecipients(); + long count = recips->Count; + long i; + for(i=1; i != count; i++) { // MAPI starts from 1 + recips->Remove(i); + } + +} //void ClientAppointment::test() { // // HRESULT hres; Index: src/cpp/outlook/ClientRecipient.cpp =================================================================== --- src/cpp/outlook/ClientRecipient.cpp (revision 0) +++ src/cpp/outlook/ClientRecipient.cpp (revision 0) @@ -0,0 +1,28 @@ +#include "outlook/ClientRecipient.h" +#include "outlook/Defs.h" + +ClientRecipient::ClientRecipient() { + name = L""; + address = L""; +} +void ClientRecipient::setCOMPtr(Redemption::ISafeRecipientPtr& ptr) { + recipient = ptr; + name = (WCHAR *)recipient->Name; + if (recipient->Resolved) { + address = (WCHAR *)recipient->Address; + } +} +Redemption::ISafeRecipientPtr& ClientRecipient::getCOMPtr() { + return recipient; +} +ClientRecipient::~ClientRecipient() { +} +const std::wstring& ClientRecipient::getName() { + return name; +} +const std::wstring& ClientRecipient::getAddress() { + return address; +} +int ClientRecipient::getRecipientType() { + return recipientType; +} Index: src/include/outlook/ClientAppointment.h =================================================================== --- src/include/outlook/ClientAppointment.h (revision 84) +++ src/include/outlook/ClientAppointment.h (working copy) @@ -43,7 +43,7 @@ #include "outlook/defs.h" #include "outlook/ClientItem.h" #include "outlook/ClientRecurrence.h" - +#include "outlook/ClientRecipient.h" #include @@ -132,7 +132,11 @@ DATE localStartDate; DATE localEndDate; - + /// Generates and returns a collection of attendees (recipients in MAP parlance) + std::list getRecipientCollection(); + void resolveRecipients(); + void addAttendee(const WCHAR* name); + void clearRecipients(); }; /** @} */ Index: src/include/outlook/ClientRecipient.h =================================================================== --- src/include/outlook/ClientRecipient.h (revision 0) +++ src/include/outlook/ClientRecipient.h (revision 0) @@ -0,0 +1,25 @@ +#ifndef INCL_CLIENTRECIPIENT +#define INCL_CLIENTRECIPIENT + +#include +#include "outlook/defs.h" +class ClientRecipient { +private: + Redemption::ISafeRecipientPtr recipient; +protected: + std::wstring name; + std::wstring address; + int recipientType; +public: + ClientRecipient(); + void setCOMPtr(Redemption::ISafeRecipientPtr& ptr); + Redemption::ISafeRecipientPtr& getCOMPtr(); + ~ClientRecipient(); + + const std::wstring& getName(); + const std::wstring& getAddress(); + int getRecipientType(); +}; + +#endif + Index: src/include/SIFFields.h =================================================================== --- src/include/SIFFields.h (revision 84) +++ src/include/SIFFields.h (working copy) @@ -120,6 +120,16 @@ }; +////////////////////////////////////////////////////////////// +/// ATTENDEE FIELDS (inside ) +////////////////////////////////////////////////////////////// +static WCHAR* attendeeFields[] = { + {L"AttendeeName" }, + {L"AttendeeEmail" }, + {L"AttendeeType" }, + {L"AttendeeStatus" }, + {NULL} +}; @@ -177,6 +187,7 @@ {L"IMAddress" }, // Returns or sets a String that represents a contact's Microsoft Instant Messenger address. {L"Importance" }, // Returns or sets the relative importance level for the Outlook item. Can be one of the following OlImportance constants: olImportanceHigh(2), olImportanceLow(0), or olImportanceNormal(1). This property corresponds to the MAPI property PR_IMPORTANCE. {L"Initials" }, // Returns or sets the initials for the contact + {L"InternetFreeBusyAddress" }, // Internet FreeBusy address URL. {L"JobTitle" }, // Returns or sets the job title for the contact {L"Language" }, // Returns or sets the language for the contact {L"LastName" }, // Returns or sets the last name for the contact @@ -211,7 +222,7 @@ {L"YomiCompanyName" }, // Returns or sets a String indicating the Japanese phonetic rendering (yomigana) of the company name for the contact {L"YomiFirstName" }, // Returns or sets a String indicating the Japanese phonetic rendering (yomigana) of the first name for the contact {L"YomiLastName" }, // Returns or sets a String indicating the Japanese phonetic rendering (yomigana) of the last name for the contact - {L"FileAs" }, // Returns or sets the default keyword string assigned to the contact when it is filed + {L"FileAs" }, // Returns or sets the default keyword string assigned to the contact when it is filed }, {NULL} };