On Wed, 2009-03-25 at 18:17 +0100, Paolo Abeni wrote: > hello, > > I'm playing with libmapi event notification and I stuck in a strange behavior. > After calling Subscribe() on the logged user mailbox, I get an error > in the next message/task (IPM.Task) creation: > the SaveChangesMessage() fails with error MAPI_E_CALL_FAILED. The call > to emsmdb_transaction() used internally by SaveChangesMessage() fails > with errocode C000000D (NT_STATUS_INVALID_PARAMETER) and enabling the > libmapi debug I get a: > > ndr_pull_error(2): Bad switch value 49156
Hi Paolo,
This generally means the object (and its data) your application
manipulates are incorrect.
You'll find below some remarks. They may not solve your current
problems, but are at least worthwhile for general purposes.
1. Your code doesn't make any use of mapi_object_init which is
*really* required to ensure libmapi objects has been initialized
properly.
2. You don't call mapi_object_release when you have finished
manipulating objects and you don't call MAPIUninitialize() which
should at least free memory properly upon exit if you missed
some objects before.
3. You should never manipulate MAPI objects private data on your
own. Not that it is incorrect, but we made them opaque so we
could manipulate / change names as much as we need without
impacting developer's application. Please use GetDefaultFolder
instead of the following static assignation:
str = (mapi_object_store_t*) store.private_data;
if (OpenFolder(&store, str->fid_inbox, &inbox) != MAPI_E_SUCCESS) {
printf("can't open inbox \n");
return -1;
}
I have btw no troubles running the code you provided in your previous
e-mail. The only difference is that I do C call and removed C++
specifics bits.
---
Julien Kerihuel
[email protected]
OpenChange Project Manager
GPG Fingerprint: 0B55 783D A781 6329 108A B609 7EF6 FE11 A35F 1F79
signature.asc
Description: This is a digitally signed message part
_______________________________________________ devel mailing list [email protected] http://mailman.openchange.org/listinfo/devel
