Ejemplo n.º 1
0
void ui_assoc_CObject::Dump( CDumpContext &dc ) const
{
	// skip over ui_assoc, as we print the assoc in a much better format!
	ui_base_class::Dump(dc);
#if !defined(_MAC) && !defined(_AFX_PORTABLE)
	// use SEH (structured exception handling) to catch even GPFs
	//  that result from partially valid objects.
	try
#endif
	{
		CObject *pOb = (CObject *)GetGoodCppObject(NULL);
		dc << ", CObject is ";
		if (pOb) {
			if (AfxIsValidAddress(pOb, sizeof(CObject)))
				pOb->Dump(dc);
			else
				afxDump << "<at invalid address!>";
		}
		else
			dc << "<NULL>";
	}
#if !defined(_MAC) && !defined(_AFX_PORTABLE)
		catch(int code) {
			// short form for trashed objects
			afxDump << "<Bad! (" << code << ")>";
		}
		catch(...) {
			// short form for trashed objects
			afxDump << "<Bad!>";
		}
#endif
}
Ejemplo n.º 2
0
void *ui_assoc_object::GetGoodCppObject(ui_type *ui_type_check) const
{
	// Get a checked association.
	PyObject *temp = (PyObject *)this;
	void *ret = GetGoodCppObject(temp, ui_type_check);
	ASSERT(this==(ui_assoc_object *)temp); // Called with this->, and this needs to be changed!
	return ret;
}
Ejemplo n.º 3
0
ui_assoc_CObject::~ui_assoc_CObject()
{
	if (bManualDelete) {
		bManualDelete = FALSE;
		CObject *pO = (CObject *)GetGoodCppObject(&type);	// get pointer before killing it.
		ASSERT(!PyErr_Occurred()); // PyErr_Clear() is bogus?????
		if (!pO)
			PyErr_Clear();
		else
			delete pO;
	}
}
Ejemplo n.º 4
0
CDialogBar *PyCDialogBar::GetDialogBar (PyObject *self)
{
	return (CDialogBar *)GetGoodCppObject( self, &type);
}
Ejemplo n.º 5
0
// this returns a pointer that should not be stored.
// Helper function that returns a CRgn object given a Python object
// Return Values: a CRgn object
CRgn *PyCRgn::GetRgn(PyObject *self)
{
	return (CRgn *)GetGoodCppObject( self, &type);
}
Ejemplo n.º 6
0
CImageList *PyCImageList::GetImageList(PyObject *self)
{
	return (CImageList *)GetGoodCppObject(self, &type);
}
Ejemplo n.º 7
0
/*static*/CDocument *PyCDocument::GetDoc(PyObject *self)
{
	return (CDocument *)GetGoodCppObject( self, &type);
}
Ejemplo n.º 8
0
// this returns a pointer that should not be stored.
HMENU PyCMenu::GetMenu(PyObject *self)
{
	return (HMENU)GetGoodCppObject( self, &type);
}