lastResult = pIdProc.CreateInstance(__uuidof(IdentificationProcessor),NULL,CLSCTX_INPROC_SERVER); if (lastResult != S_OK) { MessageBox("Unable to create identification processor object.","Error!",MB_OK); } else { lastResult = pIdProc->Initialize(pFormFix); if (lastResult != S_OK) { MessageBox("Error initializing the identification processor object.","Error!",MB_OK); } else { lastResult = pFormSetFile->Initialize(pFormDirector); if (lastResult != S_OK) { MessageBox("Error initializing the FormSetFile object.","Error!",MB_OK); } else { lastResult = pFormSetFile->put_Filename(szFormSetFileName.AllocSysString()); if (lastResult != S_OK) { MessageBox("Error trying to set the main template file name. Make sure everything is installed properly and that the paths to the common image directory is ok.","Error!",MB_OK); } else { try { lastResult = pFormSetFile->Read(); if (lastResult != S_OK) { MessageBox("Error trying to read the main template file. Make sure everything is installed properly and that the paths to the common image directory is ok.","Error!",MB_OK); } else { for (int i = 0; i < pFormSetFile->FormDefinitions->Count; i++) { IFormDefinitionFile *thisDefinitionFile; lastResult = pFormSetFile->FormDefinitions->raw_GetAt(i,&thisDefinitionFile); //thisDefinitionFile = pFormSetFile->FormDefinitions[i]; //<-- error C2660: 'GetFormDefinitions' : function does not take 1 parameters //pFormSetFile->FormDefinitions if (lastResult != S_OK) { MessageBox("Error obtaining a form definition file from the form set collection.","Error!",MB_OK); } else { //lastResult = thisDefinitionFile->Initialize(pFormSetFile); if (lastResult != S_OK) { MessageBox("Error initializing FormDefinitionFile object.","Error!",MB_OK); } else { try { lastResult = thisDefinitionFile->Read(); if (lastResult != S_OK) { MessageBox("Error reading form definition file.","Error!",MB_OK); } else { m_TemplateList.AddString(pFormSetFile->FormDefinitions->GetAt(i)->Name); IFormModelPtr newFormModel; lastResult = newFormModel.CreateInstance(__uuidof(IdentificationProcessor),NULL,CLSCTX_INPROC_SERVER); newFormModel->Initialize(pFormFix); pIdProc->FormModels->Add(newFormModel); } } catch (...) { MessageBox(pFormSetFile->Filename,"Error!",MB_OK); MessageBox(thisDefinitionFile->Filename,"Error!",MB_OK); MessageBox(thisDefinitionFile->ErrorDescription,"Error!",MB_OK); } } } } } } catch(...) { MessageBox(pFormSetFile->ErrorDescription,"Error!",MB_OK); } } } } }