wrap_funcref(&p,&nn); //not sure does not work
Where is p defined, and what is it? And where is the missing parameter that should be included per the declaration:
extern "C" wrapper_API void wrap_funcref(wrap_t *m, int *h, BSTR* b); //?
Some of this might also make a bit more sense if it was properly formatted between <pre lang="c++"></pre> tags, as my samples above. And the use of single letters for variable names is confusing.