All pastes #259861 Raw Edit

Miscellany

public cpp v1 · immutable
#259861 ·published 2006-11-27 20:35 UTC
rendered paste body
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;	}	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);		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(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(thisDefinitionFile->ErrorDescription,"Error!",MB_OK);				return;			}		}	} catch(...) {		MessageBox(pFormSetFile->ErrorDescription,"Error!",MB_OK);		return;	}}