Esempio n. 1
0
int main() {
  const int sz = 10;
  Obj o[sz];
  ObjContainer oc;
  for(int i = 0; i < sz; i++)
    oc.add(&o[i]); // Fill it up
  ObjContainer::SmartPointer sp = oc.begin();
  do {
    sp->f(); // Pointer dereference operator call
    sp->g();
  } while(++sp);
} ///:~
int main()
{
	const int sz = 10;
	Obj o[sz];
	ObjContainer oc;
	for(int i = 0; i < sz; i++)
	{
		oc.add(&o[i]);
	}
	SmartPointer sp(oc);
	do{
		sp->f();
		sp->g();
	}while(sp++);
	return 0;
}
Esempio n. 3
0
///////////////////////////////////////////////////////////////////////////////
// Funktionen, die auf die CTF-Objekt durchgreifen 
double CCoordTransService::CoordTransAspectRatio (ObjContainer &OC)
{
	if (m_fIsInitialized) {
		try {
		// Koordinaten transformieren (incl. rausrechnen der internen Skalierung)
		CCSPoint LO (UnScaleX(OC.XMin(), OC.YMax()), UnScaleY(OC.XMin(), OC.YMax()));
		CCSPoint RU (UnScaleX(OC.XMax(), OC.YMin()), UnScaleY(OC.XMax(), OC.YMin()));
		double dAspect = 1.0;
		
			THROW_FAILED_HRESULT(m_CTF -> get_AspectRatio (&LO, &RU, &dAspect));
			return dAspect;

		} catch (_com_error &e) {
			ShowError (_COM_ERROR(e), IDS_CSSERRORCAPTION, g_cbCoordTransAspectRatio);
			return 1.0;
		}
	}
	ShowError (TRIAS02_E_CSSNOTINITIALIZED, IDS_CSSERRORCAPTION, g_cbCoordTransAspectRatio);
	return 1.0;
}