Update on “Using POOM with .Net Compact Framework Whidbey”
Last summer I wrote a post about how to access the PocketOutlook Object Model (POOM) using the Beta1 build of the .Net Compact Framework (http://blogs.msdn.com/stevenpr/archive/2004/08/05/209390.aspx ). A few things have changed since then that make this scenario even easier.
Specifically, last summer’s post included instructions for registering the POOM type library on your device. This was Step 5 in the sequence of steps. Fortunately, if you are using Beta2 or later, this step is no longer needed.
The reason you no longer need to register the type library is that the Compact Framework now calls through the IUnknown-derived (vtable) portion of a dual interface by default instead of calling through IDispatch by default.
The reason we used IDispatch by default in Beta1 was because we had richer marshaling support in that code path. However, the marshaling support in our vtable marshaler now matches that of our IDispatch marshaler.
VTable is now the default because:
1) It’s simpler to use (no type libraries are needed at runtime), and
2) It performs better
Also, last summer’s post described a registry key that you could use to tell the Compact Framework which marshaler to use for dual interfaces (HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETCompactFramework\UseVTable). We’ve since removed the ability to indicate which marshaler you’d like to use, so this registry key no longer applies.
Remember too that Windows Mobile 5.0 includes managed APIs for access POOM, so you don't need to use Com Interop at all if Windows Mobile 5.0 is the only platform you are targeting.
Email as always with questions….
This posting is provided "AS IS" with no warranties, and confers no rights.