setting Metamorph Parameters

Post Reply
sbeavers
Posts: 9
Joined: Wed Jan 31, 2001 7:31 pm

setting Metamorph Parameters

Post 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?
bart
Posts: 251
Joined: Wed Apr 26, 2000 12:42 am

setting Metamorph Parameters

Post 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);
}
sbeavers
Posts: 9
Joined: Wed Jan 31, 2001 7:31 pm

setting Metamorph Parameters

Post 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.
User avatar
John
Site Admin
Posts: 2622
Joined: Mon Apr 24, 2000 3:18 pm
Location: Cleveland, OH
Contact:

setting Metamorph Parameters

Post 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)
John Turnbull
Thunderstone Software
sbeavers
Posts: 9
Joined: Wed Jan 31, 2001 7:31 pm

setting Metamorph Parameters

Post by sbeavers »

Thanks guys, the /Zp2 compile switch did the trick!
Post Reply