Page 1 of 1

setting Metamorph Parameters

Posted: Fri Mar 02, 2001 7:01 pm
by sbeavers
I am using the Metamorph APi and have a couple of questions concerning the APICP parameters. I need to set exactphrase 'on'. I tried cp->exactphrase=(byte)1 where cp is a valid apicp pointer but then I am unable to successfully open the mmapi via the openmmapi.

I also need to set the post processing on via defsuffrm. I tried cp->defsuffrm=(byte)0. However if I do this then I get a memory acces violation when I close the api. Any ideas or suggestions?

setting Metamorph Parameters

Posted: Sat Mar 03, 2001 6:47 am
by bart
Both things sound like maybe the apicp handle is not correct.

Do you have code similar to this in your app?

if((cp=openapicp())==APICPPN)
{
putmsg(MERR,Fn,"Could not create control parameters structure");
exit(255);
}

setting Metamorph Parameters

Posted: Sat Mar 03, 2001 5:39 pm
by sbeavers
Yes, that is almost exactly what I have. The openapicp() executes without a error. The Metamorph search functions are working. I just have trouble with these 2 parameters.

setting Metamorph Parameters

Posted: Sat Mar 03, 2001 6:35 pm
by John
The other possible causes of this would be either mismatched headers and libraries, in which case those structure members might not be present, or else you are using NT with different compile options and have different structure packing. Under NT we compile with a structure padding of 2. You can either compile with /Zp2, or add the following around the include files:

#pragma pack(push,Thunderstone,2)
#include "..." /* Any Thunderstone includes
#pragma pack(pop,Thunderstone)

setting Metamorph Parameters

Posted: Mon Mar 05, 2001 3:09 pm
by sbeavers
Thanks guys, the /Zp2 compile switch did the trick!