Hi Dan,
I think your problem is here:
Quote:
code
//Here is some code for the keyextractor
memset(skey, 0, sizeof(Dbt));
int b = ((Obj*) pdata.get_value())->b;
skey.set_data(b);
skey.get_data(sizeof(int));
fprintf(stderr, "\nb callback . value %d", b);
/code |
The code above will set the data *pointer* in the secondary key to the
integer *value* you want. I'm surprised that your C++ compiler doesn't
at least issue a warning about this (if not an error).
Instead, I think you need something like:
skey.set_data(&((Obj*) pdata.get_value())->b);
skey.get_data(sizeof(int));
Also note that there is no need to zero out objects with memset when
using the C++ API: the "new" operator takes care of initializing
objects.
Regards,
Michael.