in reply to Using MAPI with Exchange
In addition to the other post, maybe some help comes from Inline::CPP, which (somewhat) transparently allows you to import and access C++ objects from within Perl. On my todo-list, I have a project to venture into instantiation and handling of COM objects (starting from IUnknown), and as long as perls memory management is reference-count based instead of garbage collcetion based, COM objects could almost transparently fit into Perl. But there are many MAPI pitfalls, as MAPI uses its own memory allocator (MAPIFree() must be called to deallocate structures returned by MAPI), so implementing access to real MAPI (instead of Simple MAPI) won't be easy from Perl - but Perl would be the first language to make real MAPI a nice thing to access.
After you have managed this part, there comes another tricky part - COM callbacks into Perl. perl itself currently isn't reentrant and Perl native threads are labeled experimental for a reason. A good idea might be to implement a wrapper that exports MAPI structures via a TCP/IP port and access that gateway from Perl then - perlfunc:select is a well-understood solution to nonblocking waits.
A small note : Perl already allows access to OLE2 objects, which export a list of callable methods. This is not what COM is about - Inline::CPP would/could allow access to VTable-interfaces, which would make using almost all COM-interfaces possible.
perl -MHTTP::Daemon -MHTTP::Response -MLWP::Simple -e ' ; # The $d = new HTTP::Daemon and fork and getprint $d->url and exit;#spider ($c = $d->accept())->get_request(); $c->send_response( new #in the HTTP::Response(200,$_,$_,qq(Just another Perl hacker\n))); ' # web
|
|---|