@pymethod |PyCWinApp|FindOpenDocument|Returns an existing document with the specified file name.
| 214 | |
| 215 | // @pymethod <o PyCDocument>|PyCWinApp|FindOpenDocument|Returns an existing document with the specified file name. |
| 216 | static PyObject * |
| 217 | ui_find_open_document(PyObject *self, PyObject *args) |
| 218 | { |
| 219 | TCHAR *fileName; |
| 220 | PyObject *obfileName; |
| 221 | // @pyparm string|fileName||The fully qualified filename to search for. |
| 222 | if (!PyArg_ParseTuple(args,"O", &obfileName)) |
| 223 | return NULL; |
| 224 | CProtectedWinApp *pApp = GetProtectedApp(); |
| 225 | if (!pApp) return NULL; |
| 226 | |
| 227 | if (!PyWinObject_AsTCHAR(obfileName, &fileName, FALSE)) |
| 228 | return NULL; |
| 229 | // Let MFC framework search for a filename for us. |
| 230 | GUI_BGN_SAVE; |
| 231 | CDocument *pDoc=pApp->FindOpenDocument(fileName); |
| 232 | GUI_END_SAVE; |
| 233 | PyWinObject_FreeTCHAR(fileName); |
| 234 | if (pDoc==NULL) |
| 235 | RETURN_NONE; |
| 236 | return ui_assoc_object::make(PyCDocument::type, pDoc)->GetGoodRet(); |
| 237 | } |
| 238 | |
| 239 | // @pymethod <o PyCWinApp>|win32ui|GetApp|Retrieves the application object. |
| 240 | PyObject * |
nothing calls this directly
no test coverage detected