void CFormIdAndDropoutDlg::OnButton1Loadformset() { // TODO: Add your control notification handler code here HRESULT lastResult = S_OK; //pFormDirector->put_Debug(VARIANT_TRUE); //pFormDirector->put_ErrorLevel((PegasusImagingActiveXFormDirector1Lib::FD_ErrorLevel)2); lastResult = pIdProc.CreateInstance(__uuidof(IdentificationProcessor),NULL,CLSCTX_INPROC_SERVER); if (lastResult != S_OK) { MessageBox("Unable to create identification processor object.","Error!",MB_OK); return; } lastResult = pIdProc->Initialize(pFormFix); if (lastResult != S_OK) { MessageBox("Error initializing the identification processor object.","Error!",MB_OK); return; } lastResult = pFormSetFile->Initialize(pFormDirector); if (lastResult != S_OK) { MessageBox("Error initializing the FormSetFile object.","Error!",MB_OK); return; } CComBSTR fileName = szFormSetFileName.AllocSysString(); lastResult = pFormSetFile->put_Filename(fileName); 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); return; } 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); return; } 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); return; } try { lastResult = thisDefinitionFile->Read(); if (lastResult != S_OK) { MessageBox("Error reading form definition file.","Error!",MB_OK); return; } m_TemplateList.AddString(thisDefinitionFile->Name); IFormModelPtr newFormModel; lastResult = newFormModel.CreateInstance(__uuidof(IdentificationProcessor),NULL,CLSCTX_INPROC_SERVER); newFormModel->Initialize(pFormFix); pIdProc->FormModels->Add(newFormModel); } catch (...) { thisDefinitionFile->Release(); MessageBox(thisDefinitionFile->ErrorDescription,"Error!",MB_OK); return; } thisDefinitionFile->Release(); } } catch(...) { MessageBox(pFormSetFile->ErrorDescription,"Error!",MB_OK); return; }}