Message 1 of 6
Recover files from ObjectARX app

Not applicable
11-19-2007
11:47 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
I want to recover several files from an ObjectARX app.
I have studied an earlier topic: http://discussion.autodesk.com/thread.jspa?messageID=5255836
which seems to deal with the problem.
But compiling the code:
// by Fenton Webb, DevTech, Autodesk
// my timer proc, this will pump the recover command when Autocad is ready
void CALLBACK EXPORT RecoverTimer (HWND hWnd, UINT nMsg, UINT nIDEvent, DWORD dwTime)
{
CString cmd = _T("c:\\temp\\test.dwg\n");
// RegisterAPP() ;
COPYDATASTRUCT cmdMsg;
HWND hWndACAD;
hWndACAD = adsw_acadMainWnd();
cmdMsg.dwData = (DWORD)1;
cmdMsg.cbData = (DWORD)_tcslen(cmd) + 1;
cmdMsg.lpData = cmd.GetBuffer(cmd.GetLength()+1);
// Send the message to AutoCAD.
SendMessage(hWndACAD, WM_COPYDATA, (WPARAM)hWndACAD, (LPARAM)&cmdMsg);
acedGetAcadFrame()->KillTimer(nIDEvent);
}
void CFileRecovery::OpenDwgFromApplicationContext(void *pData)
{
if(acDocManager->isApplicationContext())
{
CString *dwgNameToOpen = reinterpret_cast(pData);
acDocManager->sendStringToExecute(curDoc(), _T("recover "));
//acDocManager->appContextOpenDocument(*dwgNameToOpen);
acedGetAcadFrame()->SetTimer(999, 1000, RecoverTimer);
}
else return;
acDocManager->setCurDocument(acDocManager->mdiActiveDocument());
}
//-----------------------------------------------------------------------------
// This is command 'OPENDWGDOC, by Fenton Webb [29/08/2003], DevTech, Autodesk
void CFileRecovery::asdkopendwgDoc()
{
CString dwgNameToOpen;
dwgNameToOpen = _T("c:\\temp\\test.dwg\n") ;
if(acDocManager->isApplicationContext())
{
acDocManager->appContextOpenDocument(dwgNameToOpen);
}
else acDocManager->executeInApplicationContext(CFileRecovery::OpenDwgFromApplicationContext, &dwgNameToOpen);
}
Result in the following compiler error:
error C3867: 'CFileRecovery::OpenDwgFromApplicationContext': function call missing argument list; use '&CFileRecovery::OpenDwgFromApplicationContext' to create a pointer to member
Does anyone have an idea of what I am missing?
Thanks
Johannes P. Hansen
I want to recover several files from an ObjectARX app.
I have studied an earlier topic: http://discussion.autodesk.com/thread.jspa?messageID=5255836
which seems to deal with the problem.
But compiling the code:
// by Fenton Webb, DevTech, Autodesk
// my timer proc, this will pump the recover command when Autocad is ready
void CALLBACK EXPORT RecoverTimer (HWND hWnd, UINT nMsg, UINT nIDEvent, DWORD dwTime)
{
CString cmd = _T("c:\\temp\\test.dwg\n");
// RegisterAPP() ;
COPYDATASTRUCT cmdMsg;
HWND hWndACAD;
hWndACAD = adsw_acadMainWnd();
cmdMsg.dwData = (DWORD)1;
cmdMsg.cbData = (DWORD)_tcslen(cmd) + 1;
cmdMsg.lpData = cmd.GetBuffer(cmd.GetLength()+1);
// Send the message to AutoCAD.
SendMessage(hWndACAD, WM_COPYDATA, (WPARAM)hWndACAD, (LPARAM)&cmdMsg);
acedGetAcadFrame()->KillTimer(nIDEvent);
}
void CFileRecovery::OpenDwgFromApplicationContext(void *pData)
{
if(acDocManager->isApplicationContext())
{
CString *dwgNameToOpen = reinterpret_cast
acDocManager->sendStringToExecute(curDoc(), _T("recover "));
//acDocManager->appContextOpenDocument(*dwgNameToOpen);
acedGetAcadFrame()->SetTimer(999, 1000, RecoverTimer);
}
else return;
acDocManager->setCurDocument(acDocManager->mdiActiveDocument());
}
//-----------------------------------------------------------------------------
// This is command 'OPENDWGDOC, by Fenton Webb [29/08/2003], DevTech, Autodesk
void CFileRecovery::asdkopendwgDoc()
{
CString dwgNameToOpen;
dwgNameToOpen = _T("c:\\temp\\test.dwg\n") ;
if(acDocManager->isApplicationContext())
{
acDocManager->appContextOpenDocument(dwgNameToOpen);
}
else acDocManager->executeInApplicationContext(CFileRecovery::OpenDwgFromApplicationContext, &dwgNameToOpen);
}
Result in the following compiler error:
error C3867: 'CFileRecovery::OpenDwgFromApplicationContext': function call missing argument list; use '&CFileRecovery::OpenDwgFromApplicationContext' to create a pointer to member
Does anyone have an idea of what I am missing?
Thanks
Johannes P. Hansen