コード例 #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
}
コード例 #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;
}
コード例 #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;
	}
}
コード例 #4
0
ファイル: win32dlgbar.cpp プロジェクト: malrsrch/pywin32
CDialogBar *PyCDialogBar::GetDialogBar (PyObject *self)
{
	return (CDialogBar *)GetGoodCppObject( self, &type);
}
コード例 #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);
}
コード例 #6
0
ファイル: win32ImageList.cpp プロジェクト: malrsrch/pywin32
CImageList *PyCImageList::GetImageList(PyObject *self)
{
	return (CImageList *)GetGoodCppObject(self, &type);
}
コード例 #7
0
ファイル: win32doc.cpp プロジェクト: malrsrch/pywin32
/*static*/CDocument *PyCDocument::GetDoc(PyObject *self)
{
	return (CDocument *)GetGoodCppObject( self, &type);
}
コード例 #8
0
ファイル: win32menu.cpp プロジェクト: malrsrch/pywin32
// this returns a pointer that should not be stored.
HMENU PyCMenu::GetMenu(PyObject *self)
{
	return (HMENU)GetGoodCppObject( self, &type);
}