I'm working on a fingerprint recognition software on c#, WPF Visual Studio 2012, I'm using secugen hamster to take the fingerprints, the software is all done, I can register the fingerprints correctly to the database and succesfull retrieve and compare them for the user access, but sometimes when the software is matching the stored fingerprint with the one just taken of the user, the method MatchIsoTemplate generates an error 'attempt to read or write protected memory. this is often an indication that other memory damaged' and the program stops, I tried to catch this with a try catch but It doesn't work, no matter what the program stops there, this is the code I'm using according to the example of secugen sdk
SGFPMISOTemplateInfo sample_info = new SGFPMISOTemplateInfo();
Int32 err = m_FPM.GetIsoTemplateInfo(customer.Huella, sample_info);
bool matched = false;
for (int i = 0; i < sample_info.TotalSamples; i++)
{
try
{
m_FPM.MatchIsoTemplate(customer.Huella, i, m_VrfMin, 0, m_SecurityLevel, ref matched);
}
catch (Exception)
{
MessageBox.Show("Try Again", "Aviso", MessageBoxButton.OK, MessageBoxImage.Hand);
}
if (matched)
{
//fill data