1) Не путай ProgressBar и StatusBar!
2) Попробуй разобраться как это работает:
//-----------------------------------------------------------------------------
//----- acrxEntryPoint.h
//-----------------------------------------------------------------------------
#include "StdAfx.h"
#include "resource.h"
class SuppressProgressMeter : public AcDbHostApplicationProgressMeter
{
public:
SuppressProgressMeter() {};
virtual ~SuppressProgressMeter() {};
void start(ACHAR* displayString) { return; }
void stop() { return; };
void meterProgress() { return; }
void setLimit(int max) { return; }
};
class SuppressProgress : public AcDbHostApplicationServices
{
public:
SuppressProgress() {
m_pOld = acdbHostApplicationServices();
acdbSetHostApplicationServices(this);
setWorkingGlobals(m_pOld->workingGlobals());
setWorkingDatabase(m_pOld->workingDatabase());
}
virtual ~SuppressProgress()
{
acdbSetHostApplicationServices(m_pOld);
setWorkingGlobals(m_pOld->workingGlobals());
setWorkingDatabase(m_pOld->workingDatabase());
}
virtual Acad::ErrorStatus findFile(
ACHAR* pcFullPathOut,
int nBufferLength,
const ACHAR* pcFilename,
AcDbDatabase * pDb,
AcDbHostApplicationServices::FindFileHint hint )
{
return Acad::eOk;
}
virtual AcadInternalServices* acadInternalServices() { return m_pOld->acadInternalServices(); }
virtual const ProdIdCode prodcode() { return m_pOld->prodcode();}
virtual void displayChar(ACHAR c) const { m_pOld->displayChar(c); return; }
virtual void displayString(const ACHAR* string, int count) const { m_pOld->displayString(string,count); return; }
virtual AcDbHostApplicationProgressMeter *newProgressMeter() {return new SuppressProgressMeter();}
private:
AcDbHostApplicationServices *m_pOld;
};
//-----------------------------------------------------------------------------
//----- ObjectARX EntryPoint
class CSupressProgressApp : public AcRxArxApp {
public:
CSupressProgressApp () : AcRxArxApp () {}
virtual AcRx::AppRetCode On_kInitAppMsg (void *pkt) {
AcRx::AppRetCode retCode = AcRxArxApp::On_kInitAppMsg (pkt) ;
return (retCode) ;
}
virtual AcRx::AppRetCode On_kUnloadAppMsg (void *pkt) {
AcRx::AppRetCode retCode = AcRxArxApp::On_kUnloadAppMsg (pkt) ;
return (retCode) ;
}
virtual void RegisterServerComponents () {}
static void SupressProgress_MyCommand1(void)
{
//---------------------------------
// Проверка запрета progressbar'а
//---------------------------------
SuppressProgress prg;
acdbCurDwg()->saveAs(_T("C:\\aaa.dwg"));
}
} ;
//-----------------------------------------------------------------------------
IMPLEMENT_ARX_ENTRYPOINT(CSupressProgressApp)
ACED_ARXCOMMAND_ENTRY_AUTO(CSupressProgressApp, SupressProgress, _MyCommand1, MyCommand1, ACRX_CMD_TRANSPARENT, NULL)