Hi I need to set a interface functionality to our model with client.

There are two models, one is our model and another their model. We will call interface function to setup our model. The interface in our model accepts only some format of parameters and needs. And not all parameters come in the same call from the client. So i need to store these parameters and call them later once i get all the required parameters.

And finally we call our model to instantiate a COM object. Later once we run some methods on these COM object. The output of these. These will be done inside their normal model method. And the output from our model calclulations is put in their output in different format.

Our o/p as i asked in other thread, runs from bottom to top and ours o/p runs from top to bottom, left to right.

static  ULONG CalcResolution_cm = 10000;
static  ULONG Radius_cm = 1000000;

static ModelUseExample & GetATModelClass()
	static ModelUseExample objATModel;
	return objATModel;

class PropagationModel :public velox::propagation_api::IPropagationModel
	void release() {};

	// Returns true if model calculates masked predictions.
	bool isMasked() { return false; };

	// Calculates the propagation for a Cartesian grid and returns true on success.
	// The output buffers need to be pre-allocated.
	// This method needs to be thread-safe!
	bool calculateGrid(const velox::propagation_api::CalculationInput& in, velox::propagation_api::CalculationOutput& out, BSTR* errorMessage)
		int nRendResolution_cm = nCalcResolution_cm;	// default to rendering at the calculation resolution
		int nNumRuns = 1;
		bool bLimitIteratorRegion = false;

	int nRendResolution_cm = nCalcResolution_cm;	// default to rendering at the calculation resolution
	int nNumRuns = 1;
	bool bLimitIteratorRegion = false;

	// Wrap the whole thing in an inner scope to force DTOR call on
	// the 'ModelUseExample' instance ...
		// ModelUseExample GetATModelClass;

		if (!GetATModelClass().InstantiateObjects())
			return 0;

	// First pasrse the Model-list.xml

	// And PROJECT-SETTINGS-LIST001.xml to get the spatial data

	// Get the static data from the from the GetPropagationModel interface to fill the ATModel
		if (!GetATModelClass().ProgramModel())
			return 0;

		int size = 0;
		float * values = NULL;
		GetATModelClass().PerformPrediction(nRendResolution_cm, bLimitIteratorRegion, size, values);
		//		HRESULT hr = GetATModelClass().SetRelationalData(in.transmitter->getPosition().x, in.transmitter->getPosition().y, in.transmitter->getPosition().z, nGroundHeight_cm, nCalcResolution_cm, nRadius_cm);

		// As of now assume unmasked model.

		// Call the prediction process
		int size;
		float * values;
		GetATModelClass().PerformPrediction(nRendResolution_cm, bLimitIteratorRegion, size, values);

		memcpy(out.propagation->getBuffer(), values, sizeof(float) * size);

		// Return the raster back to AT design in the output

		return true;


	// Calculates the propagations for Cartesian grids and returns true on success.
	// All output buffers need to be pre-allocated.
	// This method needs to be thread-safe!
	bool calculateGrids(const velox::propagation_api::CalculationInput* in, velox::propagation_api::CalculationOutput* out, size_t count, BSTR* errorMessage)
		return true;

	virtual ~PropagationModel() {}

void GetAvailablePropagationModels(BSTR* modelList)
	HRESULT hr = CoInitialize(NULL);

	MSXML2::IXMLDOMDocumentPtr pXMLDom;
	MSXML2::IXMLDOMDocumentPtr pXSLDoc;
	MSXML2::IXMLDOMDocumentPtr pXMLOut;

	// Load the XML file. 
	pXMLDom.CreateInstance(__uuidof(MSXML2::DOMDocument60), NULL, CLSCTX_INPROC_SERVER);

	pXMLDom->async = VARIANT_FALSE; // The default is true. 
	pXMLDom->validateOnParse = VARIANT_FALSE;
	pXMLDom->resolveExternals = VARIANT_FALSE;


	// Load the XSLT style sheet. 
	FAILED(pXSLDoc.CreateInstance(__uuidof(MSXML2::DOMDocument60), NULL, CLSCTX_INPROC_SERVER));

	pXSLDoc->async = VARIANT_FALSE; // The default is true. 
	pXSLDoc->validateOnParse = VARIANT_FALSE;
	pXSLDoc->resolveExternals = VARIANT_FALSE;


	// Transform the XSLT to an XML string. 
	_bstr_t xmlStr = pXMLDom->transformNode(pXSLDoc);

	//	const string xmlStr = "<?xml version=\"1.0\"?>\r\n<MODEL-LIST>\r\n<MODEL ID=\"450 MHz Default\" TYPE=\"Basic Model\" />\r\n<MODEL ID=\"900 MHz Default\" TYPE=\"Enhanced Model\" />";
	const string mfirst = "MODEL ID=\"";
	const string mlast = "\" TYPE=\"";
	const string melem = "\" />";

	const char* buf = xmlStr;
	int bstrlen = xmlStr.length();
	std::string inputstr(buf ? buf : "", bstrlen);

	stringstream check1(inputstr);
	string output;

	for (string token; getline(check1, token); ) {
		const auto firstLim = token.find(mfirst);
		const auto lastLim = token.find(mlast);
		const auto mend = token.find(melem);

		if ((firstLim != string::npos) && (lastLim != string::npos) && mend != string::npos) {
			output += (output.empty() ? "" : ",") + token.substr(firstLim + mfirst.size(), lastLim - firstLim - mfirst.size());
			output += "-" + token.substr(lastLim + mlast.size(), mend - lastLim - mlast.size());

	cout << output << endl;

velox::propagation_api::IPropagationModel* GetPropagationModel(const wchar_t* name, velox::propagation_api::StaticData* initData, BSTR* errorMessage)
	velox::propagation_api::IPropagationModel *pPropModel(NULL);

	pPropModel = new PropagationModel;

	// store the Resolution and Radius 
	CalcResolution_cm = initData->nCalcResolution_cm;
	Radius_cm = initData->nRadius_cm;

	return pPropModel;

class ModelUseExample

	bool InstantiateObjects();

	void DumpModelInfo();
	bool ProgramModel();
	void DisplayModelUI();

	template<typename intfPtr>
	void QueryForMultiHeights(intfPtr);

	void PerformPrediction(ULONG nRendResolution_cm, bool bLimitIteratorRegion, int size, float * values);
	void PerformPointPredictions();
	void PerformPointPrediction(INT64 nRX_X_cm, INT64 nRX_Y_cm);

	CComPtr<IACPredModel3> m_pModel;
	CComPtr<ACPredRasterInterfaceLib::IPredRaster9> m_pRaster;

	bool SetSpatialData(char * pHeightRasterPath, char * pClutterRasterPath, char * pBuildingRasterPath, char * pBuildingVectorPath);

	bool SetRelationalData(INT64 nX_cm, INT64 nY_cm, LONG nAntennaHeight_cm, LONG nGroundHeight_cm, ULONG nCalcResolution_cm, ULONG nRadius_cm);
	//dblAntennaMechanicalTilt_deg, dblAntennaAzimuth_deg, bstr_t(pszAntennaTypeParamsString), &nResultCode);
	bool SetMaskingData(double nAntennaMechanicalTilt_deg, double nAntennaAzimuth_deg, char * pAntennaTypeParamsString, USHORT& result);

	//SetMaskingData(dblAntennaMechanicalTilt_deg, dblAntennaAzimuth_deg, bstr_t(pszAntennaTypeParamsString), &nResultCode);

//	bool GetWellKnownRasterSectionIterator(const int nSectionID, ACPredRasterInterfaceLib::IPredRaster9 *pSourceRaster, CComPtr<ACPredRasterInterfaceLib::IACPredRasterIterator2> &cRsltSectionIterator, HRESULT &rhrRsltStatusCode)
	void DisplayRaster(ACPredRasterInterfaceLib::IPredRaster9 *pRaster, const DrawMode::Enum eMode, const ULONG nTargetRasterHandle, const ULONG nRendResolution_cm, const bool bLimitIteratorRegion);
	bool DoATMasking(const ULONG nUnmaskedRasterHandle, ULONG *pnRsltMaskedRasterHandle);

	bool GetRasterIterator(const ConstInt_PredRasterSectionID nSectionID, ACPredRasterInterfaceLib::IPredRaster9 *pRaster, const ULONG nTargetRasterHandle, const ULONG nRendResolution_cm, const bool bLimitIteratorRegion, ACPredRasterInterfaceLib::IACPredRasterIterator2 *&rpRsltRasterIter);
	void DrawBitmap(LPCSTR pszWindowTitle, const DrawMode::Enum eMode, ACPredRasterInterfaceLib::IACPredRasterIterator2 *pRasterIter, const ULONG nRendResolution_cm);

//	CComPtr<IACPredModel3> m_pModel;
	CComPtr<IACPredModel> m_pInteropModel;
	IACPredModelProgressIO *m_pJobProgressIO;
	IACPredModelAbortIO *m_pJobAborterIO;