Example #1
0
void CSelNumberDlgUsage::Change (const CString &strTableName, UINT uiCaption, CString& strAktNummer, CSelectSet* pSelectSet)
{
	try
	{	
		if (!m_pNumberDlg)
		{
			ASSERT (NULL != pSelectSet);
			ASSERT (pSelectSet -> IsOpen ());
			ASSERT (!strTableName.IsEmpty ());
			m_pNumberDlg = new CSelNumberDlg (this, pSelectSet, uiCaption,
											  strTableName);
			if (!m_pNumberDlg -> Create (IDD_SEL_NUMMER))
				AfxThrowMemoryException ();
		}		

	//	aktuelle Selektion setzen
		m_pNumberDlg -> StoreSelection (strAktNummer);

	//	Fenster aktivieren
		m_pNumberDlg -> ShowWindow (SW_SHOWNORMAL);	
		m_pNumberDlg -> SetFocus ();
	}
	catch (CDaoException *e)
	{
		:: DisplayDaoException (e);
		e -> Delete ();
		DELETE_OBJ (m_pNumberDlg);
	}
	catch (CException* e)
	{
		e -> ReportError ();
		e -> Delete ();
		DELETE_OBJ (m_pNumberDlg);
	}
}
Example #2
0
BOOL  CImportOdbcData :: Configure (void)
{
//	zuerst alten Objekte löschen
	DELETE_OBJ (m_pCImportParams);
	DELETE_OBJ (m_pCConfigDialog);
	TRY
	{
		m_pCImportParams = new CImportParams;
		g_pCParams = m_pCImportParams;		// Zeiger speichern		
		m_pCConfigDialog = new CImportSheet (IDS_IMP_CAPTION/*, g_pCOdbcExtension -> MWind ()*/);
	} 
	CATCH (CMemoryException, me)
	{
		return FALSE;
	}
	END_CATCH

	if (m_pCConfigDialog -> m_bResult)
		m_pCConfigDialog -> DoModal ();
		// m_pCConfigDialog -> Create (g_pCOdbcExtension -> MWind ());

	BOOL bRet =  m_pCImportParams -> InfoComplete ();
	if (!bRet)
		m_pCImportParams -> CleanUp ();		

	return bRet;
}
Example #3
0
///////////////////////////////////////////////////////////////////////////////
// Seite einrichten (PrintLayout-Dialog anzeigen und auswerten)
void CTRiASPreviewView::OnPreviewConfig()
{
	m_PD.m_hWndParent = m_pPrintView -> GetSafeHwnd();
	m_PD.m_pLayout -> m_lHeadlineLen = sizeof(m_cbBuffer);

CViewPrintPreview *pPreview = (CViewPrintPreview *)m_pOrigView;

	ASSERT_VALID(pPreview);
	ASSERT(pPreview -> IsKindOf(RUNTIME_CLASS(CViewPrintPreview)));
	if (DEX_ShowPrintLayoutDlg(m_PD)) {
	// Neuinitialisierung veranlassen
		m_PP.pRenderDb = NULL;
		DEX_EndPrintPreview (m_PP);
		
		m_dcPrint.Detach();         // print DC is deleted by CPrintInfo destructor
		DELETE_OBJ(m_pPreviewInfo);	// get rid of preview info
		DELETE_OBJ(m_pPreviewDC);	// Get rid of preview DC object
		
		SetPrintView (m_pPrintView);
		
	// fertig melden
		pPreview -> HasConfig();
	} 
	else if (!pPreview -> GetHasConfig()) {
	// Dialog abgebrochen --> Druckvorschau schließen
	CWnd* pMainWnd = AfxGetThread()->m_pMainWnd;

		ASSERT_VALID(pMainWnd);
		pMainWnd -> PostMessage (WM_COMMAND, AFX_ID_PREVIEW_CLOSE);	// Zeichnen abbrechen
	}
}
Example #4
0
void DeinitEffectSlot(ALeffectslot *slot)
{
    struct ALeffectslotProps *props;
    ALeffectState *state;
    size_t count = 0;

    props = ATOMIC_LOAD(&slot->Update);
    if(props)
    {
        state = ATOMIC_LOAD(&props->State, almemory_order_relaxed);
        if(state != slot->Params.EffectState)
            DELETE_OBJ(state);
        TRACE("Freed unapplied AuxiliaryEffectSlot update %p\n", props);
        al_free(props);
    }
    props = ATOMIC_LOAD(&slot->FreeList, almemory_order_relaxed);
    while(props)
    {
        struct ALeffectslotProps *next;
        state = ATOMIC_LOAD(&props->State, almemory_order_relaxed);
        next = ATOMIC_LOAD(&props->next, almemory_order_relaxed);
        DELETE_OBJ(state);
        al_free(props);
        props = next;
        ++count;
    }
    TRACE("Freed "SZFMT" AuxiliaryEffectSlot property object%s\n", count, (count==1)?"":"s");

    DELETE_OBJ(slot->Params.EffectState);
}
Example #5
0
// --------------------------------------------------------------------------------------------
STDMETHODIMP CRegOperatPropAct::EndAction (DWORD, IDataObject** ppDataOut)
{
	_ASSERTE (m_ObjsIter != m_InObjs.end());

	*ppDataOut = 0;
	try {
	WEnumLONG wEnumInObj (*m_ObjsIter);	// die zu bearbeitenden Objekte
	WEnumLONG wEnumOutObj;				// Ergebnisobjekte der ausgewählten Operation

	// Optionen abfragen
	DWORD dwOptions = 0x00;

		if (SUCCEEDED(EnsureOptionsIF())) {
			_ASSERTE(m_wOperOptions.IsValid());
			m_wOperOptions->GetOptions (&dwOptions);
		}

		// im Dialog ausgewählte Operation ausführen
		THROW_FAILED_HRESULT (m_pRegOperDlg->ExecuteOperation (m_hPr, wEnumInObj, dwOptions,
															   wEnumOutObj.ppi()));
		m_ObjsIter++;

		if (wEnumOutObj.IsValid())
		{
		// IDataObject abfragen
		WDataObject IDO (CLSID_DataTransferObject);

		// Ergebnisobjekte im DataObjekt IDO speichern
			THROW_FAILED_HRESULT (SetEnumLONGData (
				(IEnum<LONG>*)(IEnumLONG*)wEnumOutObj, IDO));

		// Resultat setzen
			*ppDataOut = IDO.detach();
			if (0 == wEnumOutObj->Count()) {
			ResString resTitel (ResID (IDS_LONGCLASSNAME, pRF), 50);
			ResString resText (ResID (IDS_BOXTEXT1, pRF), 200);
	
				MessageBox (__hWndM, resText.Addr(), resTitel.Addr(),
							MB_ICONINFORMATION | MB_OK);
			}
		}
	}
	catch (_com_error& hr_result)		// 23.09.99
	{
		DELETE_OBJ (m_pRegOperDlg);		// bei Fehler Dialog wieder freigeben
		return _COM_ERROR(hr_result);	// 23.09.99
	}

	if (m_ObjsIter != m_InObjs.end())	// es kommen noch weitere Daten
		return S_FALSE;

	DELETE_OBJ (m_pRegOperDlg);			// es kommen keine Daten mehr
	return S_OK;

} // EndAction
Example #6
0
///////////////////////////////////////////////////////////////////////////////////////////////
// IPropertyAction methods
// PropertyPages einhängen
// diese Stelle wird bei DoActions() erreicht
STDMETHODIMP CRegOperatPropAct::AddConfigPages (LPFNADDPROPSHEETPAGE lpfnAddPage,
												LPARAM lParam, LPCSTR pcDesc, UINT *puiCnt)
{
char cbCaption[_MAX_PATH];

	try
	{
		if (NULL != pcDesc)		// Caption ist gegeben
			strcpy (cbCaption, pcDesc);
		else	// von zugehöriger ClassProperty unseren Namen besorgen
			GetPropInfo (cbCaption, sizeof(cbCaption), NULL);

		// zugehörigen ConfigDialog (PropertyPage(s)) anlegen
		DELETE_OBJ (m_pRegOperDlg);	// evtl. vorherigen freigeben
		m_pRegOperDlg = CRegardOperatDlg::CreateInstance (ResID(IDD_REGOPERATPROPACT, pRF),
														  cbCaption, this, m_caSelInfo, *pRF);
		if (NULL == m_pRegOperDlg) _com_issue_error (E_OUTOFMEMORY);

		if (!IsNoShow())
		{
		// Seite hinzufügen, wenn selbige angezeigt werden soll
		HPROPSHEETPAGE hPSP = m_pRegOperDlg -> CreatePage();

			if (NULL == hPSP) return E_HANDLE;
			if (!(*lpfnAddPage) (hPSP, lParam))
				return E_UNEXPECTED;
		}

		// Initialisierungsdaten für den Dialog wurden von Load() bereitgestellt, konnten aber
		// noch nicht an diesen weitergereicht werden
		if (m_bHasInitData)
		{
		// Initialisierungsdaten jetzt an den Dialog weiterreichen
		HRESULT	hr = m_pRegOperDlg->SetSelectedInfo (&m_caSelInfo, IsNoShow());

			if (FAILED(hr)) _com_issue_error(hr);
		}

		if (NULL != puiCnt) 
			*puiCnt = IsNoShow() ? 0 : 1;	// "1" ist die Anzahl der einzuhängenden Pages

	}
	catch (_com_error& e)
	{
		DELETE_OBJ (m_pRegOperDlg);
		if (puiCnt) *puiCnt = 0;
		return _COM_ERROR (e);
	}

	return S_OK;

} // AddConfigPages
Example #7
0
void CSpatialTreeNode::Clear()
{
	for (int i = 0; i < m_nSubNodes; ++i) {
		DELETE_OBJ(m_apsSubNode[i]);
	}
	m_nSubNodes = 0;

	for (int j = 0; j < m_nFeatureCount; ++j) {
		DELETE_OBJ(m_pFeatureIds[j]);
	}
	m_nFeatureCount = 0;
	SfFree (m_pFeatureIds);		// wurde mit malloc/realloc angelegt
	m_pFeatureIds = NULL;
}
Example #8
0
/////////////////////////////////////////////////////////////////////////////
// IPropertyAction methods
STDMETHODIMP CTextSearchEngine::AddConfigPages (LPFNADDPROPSHEETPAGE lpfnAddPage, 
								LPARAM lParam, LPCSTR pcDesc, UINT *puiCnt)
{
char cbCaption[128];

	try {
		if (NULL != pcDesc)		// Caption ist gegeben
			strcpy (cbCaption, pcDesc);
		else	// von zugehöriger ClassProperty unseren Namen besorgen
			GetPropInfo (cbCaption, sizeof(cbCaption), NULL);

	// Kontext des Dialoges feststellen
	WClassProperty Cls;
	bool fChoice = false;

		if (SUCCEEDED(GetSite (IID_IClassProperty, Cls.ppv()))) {
		// Kontext ist entweder PropertyChoice oder PropertySequence 
		DWORD dwFlags = 0;

			if (SUCCEEDED(Cls -> GetPropInfo (NULL, 0, &dwFlags)))
				fChoice = (dwFlags & PROPCAPS_CONTAINER_IS_CHOICE) ? true : false;
		}

	// zugehörigen ConfigDialog (PropertyPage(s)) anlegen
	ResourceFile RF (g_pDLLName);
	UINT uiRes = fChoice ? IDD_TEXTSEARCHENGINE_CFGPP : IDD_TEXTSEARCHENGINE_CFG;

		DELETE_OBJ(m_pCfgDlg);	// evtl. vorherigen freigeben
		m_pCfgDlg = CCfgTextSearch::CreateInstance (this, 
						ResID (uiRes, &RF), cbCaption);
		if (NULL == m_pCfgDlg) _com_issue_error(E_OUTOFMEMORY);

	HPROPSHEETPAGE hPSP = this -> CreatePage(m_pCfgDlg);

		if (NULL == hPSP || !lpfnAddPage(hPSP, lParam))
			_com_issue_error(E_UNEXPECTED);

		if (puiCnt) *puiCnt = 1;

		m_pCfgDlg -> InitWithData (m_Status);

	} catch (_com_error& hr_result) {
		DELETE_OBJ (m_pCfgDlg);
		if (puiCnt) *puiCnt = 0;
		return _COM_ERROR(hr_result);
	}
	return S_OK;
}
Example #9
0
// --------------------------------------------------------------------------------------------
CNewArea::~CNewArea (void)
{
	DELETE_OBJ (m_pCT);
	DELETE_VEC (m_pGrabPktX);
	DELETE_VEC (m_pGrabPktY);
    m_wDragObj.Assign (NULL);
}
Example #10
0
// wird für jedes zu löschende Item gerufen
void CObjectClassStatistics::DeletingItem(HTREEITEM hItem)
{
CItemCallback *pItemCB = reinterpret_cast<CItemCallback *>(GetItemData(hItem));

	DELETE_OBJ(pItemCB);
	SetItemData(hItem, NULL);
}
Example #11
0
HRESULT CBlobService::MakeTextVertices (BYTE *pBlob, double_v &rX, double_v &rY, void *pData)
{
	USES_CONVERSION;

TEXTBLOBDATA *pTBD = (TEXTBLOBDATA *)pData;

	pBlob += sizeof(GUID);						// GUID übergehen

	rX.push_back (((POINTBASE *)pBlob) -> X);	// Koordinaten lesen								
	rY.push_back (((POINTBASE *)pBlob) -> Y);
	pBlob += sizeof(POINTBASE);

	RetrieveAndAdvance(pTBD -> dRotation, pBlob);
	pBlob += sizeof(POINTBASE);					// Normale übergehen
	RetrieveAndAdvance(pTBD -> lFlags, pBlob);

// Text einlesen
ULONG uiTextSize = 0;
LPOLESTR pText = NULL;

	RetrieveAndAdvance(uiTextSize, pBlob);
	ATLTRY(pText = new OLECHAR[uiTextSize]);
	if (NULL == pText) return E_OUTOFMEMORY;

	RetrieveAndAdvance(pText, pBlob, uiTextSize);
	pTBD -> strText = OLE2A(pText);
	DELETE_OBJ(pText);

	return S_OK;
}
Example #12
0
void ALeffectState_DecRef(ALeffectState *state)
{
    uint ref;
    ref = DecrementRef(&state->Ref);
    TRACEREF("%p decreasing refcount to %u\n", state, ref);
    if(ref == 0) DELETE_OBJ(state);
}
Example #13
0
///////////////////////////////////////////////////////////////////////////////
// Geometriebaum (Quadtree)
BOOL CSpatialTree::Init (long lTileCnt, double *padfBoundsMin, 
		double *padfBoundsMax, int nMaxDepth)
{
	DELETE_OBJ(m_psRoot);

	_ASSERTE(NULL != padfBoundsMin && NULL != padfBoundsMax);

// If no max depth was defined, try to select a reasonable one
// that implies approximately 8 shapes per node.
	if (0 == nMaxDepth) {
	int nMaxNodeCount = 1;

		while (4 * nMaxNodeCount < lTileCnt)
		{
			++nMaxDepth;
			nMaxNodeCount = 2 * nMaxNodeCount;
		}
	}
	m_nMaxDepth = nMaxDepth;

// Allocate the root node.

// Assign the bounds to the root node. If none are passed in,
// use the bounds of the provided file otherwise the create
// function will have already set the bounds.
	ATLTRY(m_psRoot = new CSpatialTreeNode(padfBoundsMin, padfBoundsMax));
	return (NULL != m_psRoot) ? TRUE : FALSE;
}
Example #14
0
AL_API ALvoid AL_APIENTRY alGenAuxiliaryEffectSlots(ALsizei n, ALuint *effectslots)
{
    ALCcontext *context;
    VECTOR(ALeffectslot*) slotvec;
    ALsizei cur;
    ALenum err;

    context = GetContextRef();
    if(!context) return;

    VECTOR_INIT(slotvec);

    if(!(n >= 0))
        SET_ERROR_AND_GOTO(context, AL_INVALID_VALUE, done);
    if(!VECTOR_RESERVE(slotvec, n))
        SET_ERROR_AND_GOTO(context, AL_OUT_OF_MEMORY, done);

    for(cur = 0;cur < n;cur++)
    {
        ALeffectslot *slot = al_calloc(16, sizeof(ALeffectslot));
        err = AL_OUT_OF_MEMORY;
        if(!slot || (err=InitEffectSlot(slot)) != AL_NO_ERROR)
        {
            al_free(slot);
            alDeleteAuxiliaryEffectSlots(cur, effectslots);
            SET_ERROR_AND_GOTO(context, err, done);
        }

        err = NewThunkEntry(&slot->id);
        if(err == AL_NO_ERROR)
            err = InsertUIntMapEntry(&context->EffectSlotMap, slot->id, slot);
        if(err != AL_NO_ERROR)
        {
            FreeThunkEntry(slot->id);
            DELETE_OBJ(slot->Params.EffectState);
            al_free(slot);

            alDeleteAuxiliaryEffectSlots(cur, effectslots);
            SET_ERROR_AND_GOTO(context, err, done);
        }

        aluInitEffectPanning(slot);

        VECTOR_PUSH_BACK(slotvec, slot);

        effectslots[cur] = slot->id;
    }
    err = AddEffectSlotArray(context, VECTOR_BEGIN(slotvec), n);
    if(err != AL_NO_ERROR)
    {
        alDeleteAuxiliaryEffectSlots(cur, effectslots);
        SET_ERROR_AND_GOTO(context, err, done);
    }

done:
    VECTOR_DEINIT(slotvec);

    ALCcontext_DecRef(context);
}
Example #15
0
ALenum InitializeEffect(ALCdevice *Device, ALeffectslot *EffectSlot, ALeffect *effect)
{
    ALenum newtype = (effect ? effect->type : AL_EFFECT_NULL);
    ALeffectStateFactory *factory;

    if(newtype != EffectSlot->Effect.Type)
    {
        ALeffectState *State;
        FPUCtl oldMode;

        factory = getFactoryByType(newtype);
        if(!factory)
        {
            ERR("Failed to find factory for effect type 0x%04x\n", newtype);
            return AL_INVALID_ENUM;
        }
        State = V0(factory,create)();
        if(!State)
            return AL_OUT_OF_MEMORY;

        SetMixerFPUMode(&oldMode);
        /* FIXME: This just needs to prevent the device from being reset during
         * the state's device update, so the list lock in ALc.c should do here.
         */
        ALCdevice_Lock(Device);
        State->OutBuffer = Device->Dry.Buffer;
        State->OutChannels = Device->Dry.NumChannels;
        if(V(State,deviceUpdate)(Device) == AL_FALSE)
        {
            ALCdevice_Unlock(Device);
            RestoreFPUMode(&oldMode);
            DELETE_OBJ(State);
            return AL_OUT_OF_MEMORY;
        }
        ALCdevice_Unlock(Device);
        RestoreFPUMode(&oldMode);

        if(!effect)
        {
            EffectSlot->Effect.Type = AL_EFFECT_NULL;
            memset(&EffectSlot->Effect.Props, 0, sizeof(EffectSlot->Effect.Props));
        }
        else
        {
            EffectSlot->Effect.Type = effect->type;
            memcpy(&EffectSlot->Effect.Props, &effect->Props, sizeof(EffectSlot->Effect.Props));
        }

        EffectSlot->Effect.State = State;
        UpdateEffectSlotProps(EffectSlot, AL_TRUE);
    }
    else if(effect)
    {
        memcpy(&EffectSlot->Effect.Props, &effect->Props, sizeof(EffectSlot->Effect.Props));
        UpdateEffectSlotProps(EffectSlot, AL_FALSE);
    }

    return AL_NO_ERROR;
}
Example #16
0
ALenum InitializeEffect(ALCdevice *Device, ALeffectslot *EffectSlot, ALeffect *effect)
{
    ALenum newtype = (effect ? effect->type : AL_EFFECT_NULL);
    ALeffectStateFactory *factory;

    if(newtype != EffectSlot->Effect.Type)
    {
        ALeffectState *State;
        FPUCtl oldMode;

        factory = getFactoryByType(newtype);
        if(!factory)
        {
            ERR("Failed to find factory for effect type 0x%04x\n", newtype);
            return AL_INVALID_ENUM;
        }
        State = V0(factory,create)();
        if(!State) return AL_OUT_OF_MEMORY;

        SetMixerFPUMode(&oldMode);
        almtx_lock(&Device->BackendLock);
        State->OutBuffer = Device->Dry.Buffer;
        State->OutChannels = Device->Dry.NumChannels;
        if(V(State,deviceUpdate)(Device) == AL_FALSE)
        {
            almtx_unlock(&Device->BackendLock);
            RestoreFPUMode(&oldMode);
            DELETE_OBJ(State);
            return AL_OUT_OF_MEMORY;
        }
        almtx_unlock(&Device->BackendLock);
        RestoreFPUMode(&oldMode);

        if(!effect)
        {
            EffectSlot->Effect.Type = AL_EFFECT_NULL;
            memset(&EffectSlot->Effect.Props, 0, sizeof(EffectSlot->Effect.Props));
        }
        else
        {
            EffectSlot->Effect.Type = effect->type;
            EffectSlot->Effect.Props = effect->Props;
        }

        EffectSlot->Effect.State = State;
        UpdateEffectSlotProps(EffectSlot);
    }
    else if(effect)
    {
        EffectSlot->Effect.Props = effect->Props;
        UpdateEffectSlotProps(EffectSlot);
    }

    return AL_NO_ERROR;
}
Example #17
0
HRESULT CAddFunctionDlg::DeleteTemplates()
{
	int iCnt = m_cbxNotification.GetCount();
	for (int i = 0; i < iCnt; i++) 
	{
		CTemplateManagement *pTM = NULL;
		pTM = (CTemplateManagement *)m_cbxNotification.GetItemData(i);
		DELETE_OBJ(pTM);
	}
	return S_OK;
}
Example #18
0
/////////////////////////////////////////////////////////////////////////////
// Bestimmt den konkreten TargetPointer in Abhängigkeit von dem MerkmalsTyp
long GetMerkmalTarget (HPROJECT hPr, void *pTarget, short iTTyp)
{
	switch (iTTyp) {
	case OBL_OLD:	// direkt ObjektNummer
		TX_ASSERT((long)pTarget > 0);
		return (long)pTarget;

	case IDL_OLD:	// Identifikator ist gegeben
		{
		long ID = (long)pTarget;
		ErrInstall EI (WC_NOTFOUND);
		DB_ADDR_IDL dbaIDL(hPr);

			TX_ASSERT(ID != 0L && ID != -1L);

//			dbaIDL.file_no = IDL;
			if (z_keyfind (&dbaIDL, IDN_OLD, &ID) != EC_OKAY)
				return -1L;
			return dbaIDL.rec_no;
		}
		break;

	case SICHT:
		if (pTarget != NULL) {
		char *pSicht = new char [41];

			if (pSicht == NULL) return -1L;

			TX_ASSERT(TIsValidString ((char *)pTarget));

			memset (pSicht, '\0', 41);
			strcpy (pSicht, (char *)pTarget);

//			AnsiToOem (pSicht, pSicht);	// Zeichensatz konvertieren

		ErrInstall EI (WC_NOTFOUND);
		DB_ADDR dbaSICHT(hPr);
		long result = -1;

			dbaSICHT.file_no = SICHT;
			if (z_keyfind (&dbaSICHT, SICHTNAME, pSicht) == EC_OKAY)
				result = dbaSICHT.rec_no;
			DELETE_OBJ (pSicht);
			return result;
		} else
			return -1L;
		break;

	default:
		TX_ASSERT(false);
		break;
	}
	return -1L;
}
Example #19
0
bool ImportGeometry (HPROJECT hPr, 
	OBJGEOMETRIE *pOG, long sta[], long lIdent, double *gxi, double *gyi, 
	int iFlags, long &rlONr, ULONG &lIgnore)
{
	INITSTRUCT (*pOG, OBJGEOMETRIE);
	pOG -> lONr = 0L;
	pOG -> lIdent = lIdent;
	pOG -> iFlags = short(iFlags);
	pOG -> pdblX = gxi;
	pOG -> pdblY = gyi;
	((TEXTGEOMETRIEEX &)pOG).fIndObjProp = FALSE;

	switch (sta[1]) {
	case O_PUNKT:
		pOG -> iObjTyp = OGPunkt;
		break;

	case O_LINIE:
		pOG -> iObjTyp = OGLinie;
		break;

	case O_FLAECHE:
		pOG -> iObjTyp = OGFlaeche;
		pOG -> iKCnt = AnalyzeAreaContures (lgi, gxi, gyi, &pOG -> plCnt);
		break;

	case O_TEXTOBJEKT:
		pOG -> iObjTyp = OGText;
		pOG -> iKCnt = RetrieveText (lTextObjMCode, mi, &((TEXTGEOMETRIE *)pOG) -> pText, true);
		lIgnore = lTextObjMCode;
		break;

	case O_TEXTOBJIND:
		pOG -> dwSize = sizeof(TEXTGEOMETRIEEX);
		pOG -> iObjTyp = OGLabel;
		pOG -> iKCnt = RetrieveText (lTextObjMCode, mi, &((TEXTGEOMETRIE *)pOG) -> pText, true);
		((TEXTGEOMETRIEEX &)pOG).fIndObjProp = TRUE;
		lIgnore = lTextObjMCode;
		break;
	}
	pOG -> lCnt = lgi;

GEOMETRIEWITHCS GCS;

	INITSTRUCT (GCS, GEOMETRIEWITHCS);
	GCS.pOG = pOG;
	GCS.pICS = ((CImpAscExtension *)g_pTE)->get_CS();

bool fRet = DEX_ModObjGeometrieEx(hPr, GCS);

	DELETE_OBJ(pOG -> plCnt);
	rlONr = pOG -> lONr;		// neue ObjektNummer
	return fRet;
}
Example #20
0
// Geometrie nicht modifizieren, nur Merkmale/Ident korrigieren ---------------
bool UpdateFeatures (HPROJECT hPr, LONG &rlONr, ULONG lIdent, long sta[], long mi[])
{
// Objekt wiederfinden
char *pUIdent = NULL;
	
	rlONr = 0L;

	TX_ASSERT(!(g_fAbglGeom && g_fAbglAttr));	// nie gleichzeitig Attribs und Geometrie abgleichen!

// versuchen über GUID zu finden
	if ('\0' != guid[0]) {
	OBJECTGUID OUID;

		INITSTRUCT (OUID, OBJECTGUID);
		if (SUCCEEDED(CLSIDFromString (WideString(guid), &OUID.guid))) {
			if (SUCCEEDED(DEX_FindObjectFromGuidEx (hPr, OUID)))
				rlONr = OUID.lONr;
		}
	}

// versuchen, über Unique Ident zu finden
	if (0 == rlONr && RetrieveText (g_ulUniqueId, mi, &pUIdent, false, !g_fImportObj) > 0) 
		rlONr = FindObject (g_ulUniqueId, pUIdent);

	DELETE_OBJ(pUIdent);

	if (rlONr > 0) {		// Merkmale erzeugen
		if (m_flag && !CreateFeatures (rlONr, mi, lIdent)) {
			g_lWithErrors++;	// mit Fehlern importiert
			return false;
		}

	ULONG lOldId = (ULONG)DEX_GetObjIdent (rlONr);

		if (lIdent != lOldId) {
		MODOBJIDENT MOI;

			INITSTRUCT(MOI, MODOBJIDENT);
			MOI.lONr = rlONr;
			MOI.lNewIdent = lIdent;
			MOI.iMode = 0;
			if (!DEX_ModObjectIdent (MOI)) {
				g_lWithErrors++;	// mit Fehlern importiert
				return false;
			}
		}
		CountObjects (sta[1]);
		return true;
	} else
		g_lNotImported++;		// nicht wiedergefunden

    return false;
}
Example #21
0
CCheckTreeView::~CCheckTreeView (void) 
{
	if (m_fUseCheckMarks) {
	CImageList *pIList = SetImageList (NULL, TVSIL_STATE);

		DELETE_OBJ (pIList);
	}
	
	DeleteAllItems();
	if (GetTree()) 
		delete GetTree();
}
Example #22
0
HRESULT CAddFunctionDlg::SetTemplatePieces()
{
	HRESULT hr = NOERROR;
	CTemplateManagement *pTM = NULL;
	BOOL fDelete = false;
	try
	{
		// Wenn Notification, dann alle Funktionselemente aus diesem Item holen
		if (1 == m_chckNotification.GetCheck()) 
		{	// Istein Text im EditCtrl ?
			CString str;
			m_cbxNotification.GetWindowText(str);
			if (str.IsEmpty()) _com_issue_error(E_INVALIDARG);
			// Wenn je, liefere den Index
			int iFind = m_cbxNotification.FindString(-1, str);
			if (CB_ERR == iFind) _com_issue_error(E_FAIL);
			// Den Templtemenager geben lassen
			DWORD dw = m_cbxNotification.GetItemData(iFind);
			if (CB_ERR == dw) _com_issue_error(E_FAIL);
			pTM = (CTemplateManagement *)dw;
		} 
		else 
		{
			fDelete = true;
			THROW_FAILED_HRESULT(MakeTemplate(&pTM));
		}

		char str	[MAXSTRLENGTH]; *str = '\0';
		char strType[MAXSTRLENGTH];	*strType = '\0';
		char strPar [MAXSTRLENGTH];	*strPar = '\0';
		char strName[MAXSTRLENGTH];	*strName = '\0';
		char strComment[MAXSTRLENGTH]; *strComment = '\0';

		THROW_FAILED_HRESULT(pTM -> GetComment(strComment, MAXSTRLENGTH));
		THROW_FAILED_HRESULT(pTM -> GetDeclaration(str, MAXSTRLENGTH));
		THROW_FAILED_HRESULT(pTM -> GetParams(strPar, MAXSTRLENGTH));
		THROW_FAILED_HRESULT(pTM -> GetName(strName, MAXSTRLENGTH));
		THROW_FAILED_HRESULT(pTM -> GetType(strType, MAXSTRLENGTH));

		m_strTyp = strType;		
		m_strParams = strPar;
		m_strDeclaration = str;
		m_strName = strName;
		m_strComment = strComment;
	}
	catch (_com_error& e)
	{
		hr = _COM_ERROR(e);
	}
	if (fDelete) DELETE_OBJ(pTM);
	return hr;
}
Example #23
0
AL_API ALvoid AL_APIENTRY alGenAuxiliaryEffectSlots(ALsizei n, ALuint *effectslots)
{
    ALCcontext *context;
    ALeffectslot *first, *last;
    ALsizei cur;
    ALenum err;

    context = GetContextRef();
    if(!context) return;

    if(!(n >= 0))
        SET_ERROR_AND_GOTO(context, AL_INVALID_VALUE, done);

    first = last = NULL;
    for(cur = 0;cur < n;cur++)
    {
        ALeffectslot *slot = al_calloc(16, sizeof(ALeffectslot));
        err = AL_OUT_OF_MEMORY;
        if(!slot || (err=InitEffectSlot(slot)) != AL_NO_ERROR)
        {
            al_free(slot);
            alDeleteAuxiliaryEffectSlots(cur, effectslots);
            SET_ERROR_AND_GOTO(context, err, done);
        }

        err = NewThunkEntry(&slot->id);
        if(err == AL_NO_ERROR)
            err = InsertUIntMapEntry(&context->EffectSlotMap, slot->id, slot);
        if(err != AL_NO_ERROR)
        {
            FreeThunkEntry(slot->id);
            DELETE_OBJ(slot->Params.EffectState);
            al_free(slot);

            alDeleteAuxiliaryEffectSlots(cur, effectslots);
            SET_ERROR_AND_GOTO(context, err, done);
        }

        aluInitEffectPanning(slot);

        if(!first) first = slot;
        if(last) ATOMIC_STORE(&last->next, slot);
        last = slot;

        effectslots[cur] = slot->id;
    }
    AddEffectSlotList(context, first, last);

done:
    ALCcontext_DecRef(context);
}
Example #24
0
void CBranchPage::Change (const CString &strTableName, UINT uiCaption)
//	TODO: Add your control notification handler code here
{
    try
    {
        if (!m_pNumberDlg)
        {
            ASSERT (NULL != m_pSet);
            ASSERT (m_pSet -> IsOpen ());
            ASSERT (!strTableName.IsEmpty ());
            m_pNumberDlg = new CSelNumberDlg (this, m_pSet, uiCaption,
                                              strTableName);
            if (!m_pNumberDlg -> Create (IDD_SEL_NUMMER))
                AfxThrowMemoryException ();
        }

        //	aktuelle Selektion setzen
        CString strOldName;
        m_edNummer.GetWindowText (strOldName);
        m_pNumberDlg -> StoreSelection (strOldName);

        //	Fenster aktivieren
        m_pNumberDlg -> ShowWindow (SW_SHOWNORMAL);
        m_pNumberDlg -> SetFocus ();
    }
    catch (CDaoException *e)
    {
        :: DisplayDaoException (e);
        e -> Delete ();
        DELETE_OBJ (m_pNumberDlg);
    }
    catch (CException* e)
    {
        e -> ReportError ();
        e -> Delete ();
        DELETE_OBJ (m_pNumberDlg);
    }
}
Example #25
0
bool IrisWind::SetActiveScaling (long lZoom)
{
ObjContainer OC (0, 0, 0, 0);
ObjContainer oldOC = DBO().GetExtend();		// alten Ausschnitt merken
bool fResult = false;
Rectangle rcC (0, 0, 0, 0);

	for (int i = 0; i < 2; i++) {
		rcC = CanvasRect();

	Rectangle rc;
	
		if (NULL != m_pDRO) {
			rc = ((DragRectangleObject *)m_pDRO) -> GetRect();

		// Koordinaten kippen
		CoOrd tmpC = CoOrd(rc.Bottom() - rc.Top());
		
			rc.Bottom() = CoOrd(rc.Top() - tmpC);
		} else
			rc = rcC;
				
		fResult = DBO().SetActiveScaling (lZoom, rc, rcC, OC);
		if (!fResult) break;
	
	// neuen Ausschnitt einstellen
		SetExtend (OC, lZoom);

	// bei Bedarf ScrollBars einblenden und initialisieren
		if (!InitWndScrollBars())
			break;		// einmal reicht, wenn Scrollbars nicht geändert wurden
	}

// wenn Erfolgreich, dann alles neu einstellen
	if (fResult) {
		DELETE_OBJ (m_pDRO);

	// Übersichtsfenster bedienen
		if (OverViewCFlag && pOverView) 
			pOverView -> SetActVP (CanvasRect());
		actClip.Push (oldOC);

	// neu zeichnen
		LegendToRepaint = true;
		m_fRePaintFlag = true;
		RePaint();
	}

return fResult;
}
Example #26
0
void UpdateEffectSlotProps(ALeffectslot *slot, ALboolean withstate)
{
    struct ALeffectslotProps *props;
    ALeffectState *oldstate;

    /* Get an unused property container, or allocate a new one as needed. */
    props = ATOMIC_LOAD(&slot->FreeList, almemory_order_acquire);
    if(!props)
        props = al_calloc(16, sizeof(*props));
    else
    {
        struct ALeffectslotProps *next;
        do {
            next = ATOMIC_LOAD(&props->next, almemory_order_relaxed);
        } while(ATOMIC_COMPARE_EXCHANGE_WEAK(struct ALeffectslotProps*,
                &slot->FreeList, &props, next, almemory_order_seq_cst,
                almemory_order_consume) == 0);
    }

    /* Copy in current property values. */
    ATOMIC_STORE(&props->Gain, slot->Gain, almemory_order_relaxed);
    ATOMIC_STORE(&props->AuxSendAuto, slot->AuxSendAuto, almemory_order_relaxed);

    ATOMIC_STORE(&props->Type, slot->Effect.Type, almemory_order_relaxed);
    memcpy(&props->Props, &slot->Effect.Props, sizeof(props->Props));
    /* Swap out any stale effect state object there may be in the container, to
     * delete it.
     */
    ATOMIC_STORE(&props->UpdateState, withstate, almemory_order_relaxed);
    oldstate = ATOMIC_EXCHANGE(ALeffectState*, &props->State,
        withstate ? slot->Effect.State : NULL, almemory_order_relaxed
    );

    /* Set the new container for updating internal parameters. */
    props = ATOMIC_EXCHANGE(struct ALeffectslotProps*, &slot->Update, props,
                            almemory_order_acq_rel);
    if(props)
    {
        /* If there was an unused update container, put it back in the
         * freelist.
         */
        struct ALeffectslotProps *first = ATOMIC_LOAD(&slot->FreeList);
        do {
            ATOMIC_STORE(&props->next, first, almemory_order_relaxed);
        } while(ATOMIC_COMPARE_EXCHANGE_WEAK(struct ALeffectslotProps*,
                &slot->FreeList, &first, props) == 0);
    }

    DELETE_OBJ(oldstate);
}
Example #27
0
ALvoid ReleaseALAuxiliaryEffectSlots(ALCcontext *Context)
{
    ALsizei pos;
    for(pos = 0;pos < Context->EffectSlotMap.size;pos++)
    {
        ALeffectslot *temp = Context->EffectSlotMap.array[pos].value;
        Context->EffectSlotMap.array[pos].value = NULL;

        DELETE_OBJ(temp->EffectState);

        FreeThunkEntry(temp->id);
        memset(temp, 0, sizeof(ALeffectslot));
        al_free(temp);
    }
}
Example #28
0
CSpatialTreeNode::~CSpatialTreeNode()
{
	for (int i = 0; i < m_nSubNodes; ++i)
	{
		if (NULL != m_apsSubNode[i]) {
			DELETE_OBJ(m_apsSubNode[i]);
		}
	}

	for (int j = 0; j < m_nFeatureCount; ++j) {
		if (NULL != m_pFeatureIds[i])
			m_pFeatureIds[i] -> Release();
	}
	SfFree (m_pFeatureIds);		// wurde mit malloc/realloc angelegt
}
Example #29
0
void CPtrListExt :: RemoveAll ()
{
	if (IsEmpty ())
		return;

	CRecordInfo *pInfo = NULL;
	POSITION pos = GetHeadPosition();
	while (pos != NULL)
	{
		pInfo = (CRecordInfo *) GetNext(pos);	// Destruktor wird ohne
		ASSERT (NULL != pInfo);					// cast nicht gerufen !
		DELETE_OBJ (pInfo);
	}

	CPtrList::RemoveAll ();
}
Example #30
0
void UpdateEffectSlotProps(ALeffectslot *slot)
{
    struct ALeffectslotProps *props;
    ALeffectState *oldstate;

    props = ATOMIC_EXCHANGE(struct ALeffectslotProps*, &slot->Update, NULL);
    if(props)
    {
        /* If there was an unapplied update, check if its state object is the
         * same as the current in-use one, or the one that will be set. If
         * neither, delete it.
         */
        oldstate = ATOMIC_EXCHANGE(ALeffectState*, &props->State, NULL, almemory_order_relaxed);
        if(oldstate != slot->Params.EffectState && oldstate != slot->Effect.State)
            DELETE_OBJ(oldstate);
    }
    else
    {