//-----------------------------------------------------------------------------
//----- acrxEntryPoint.cpp
//-----------------------------------------------------------------------------
#include "StdAfx.h"
#include "resource.h"
//-----------------------------------------------------------------------------
#define szRDS _RXST("")
const TCHAR ThroughAcedSetFunHelp[] = _T("ThroughAcedSetFunHelp");
CString helpPath;
CString helpTopic;
//-----------------------------------------------------------------------------
//----- ObjectARX EntryPoint
class CMyHelpApp : public AcRxArxApp {
public:
CMyHelpApp () : AcRxArxApp () {}
void GetHelpPath()
{
TCHAR buffer[_MAX_PATH] = _T("");
GetModuleFileName(_hdllInstance,buffer,sizeof(buffer));
TCHAR path_buffer[_MAX_PATH];
TCHAR drive[_MAX_DRIVE];
TCHAR dir[_MAX_DIR];
TCHAR fname[_MAX_FNAME];
TCHAR ext[_MAX_EXT];
_tsplitpath( buffer, drive, dir, fname, ext );
_tmakepath(path_buffer,drive,dir,fname,_T(".chm"));
helpPath = path_buffer;
}
virtual AcRx::AppRetCode On_kInitAppMsg (void *pkt) {
// TODO: Load dependencies here
// You *must* call On_kInitAppMsg here
AcRx::AppRetCode retCode =AcRxArxApp::On_kInitAppMsg (pkt) ;
// TODO: Add your initialization code here
GetHelpPath();
return (retCode) ;
}
virtual AcRx::AppRetCode On_kUnloadAppMsg (void *pkt) {
// TODO: Add your code here
// You *must* call On_kUnloadAppMsg here
AcRx::AppRetCode retCode =AcRxArxApp::On_kUnloadAppMsg (pkt) ;
// TODO: Unload dependencies here
return (retCode) ;
}
virtual void RegisterServerComponents () {
}
// Команда AcedSetFunHelp
static void MyGroupThroughAcedSetFunHelp () {
acedSetFunHelp(ThroughAcedSetFunHelp,LPCTSTR(helpPath),ThroughAcedSetFunHelp,0);
ads_point p;
acutPrintf(_T("\nPath=%s"),LPCTSTR(helpPath));
acedGetPoint(NULL,_T("\nНажмите F1 для справки: "), p);
}
// Команда ThroughAcedHelp
static void MyGroupThroughAcedHelp () {
acedHelp(LPCTSTR(helpPath),ThroughAcedSetFunHelp,0);
}
} ;
//-----------------------------------------------------------------------------
IMPLEMENT_ARX_ENTRYPOINT(CMyHelpApp)
ACED_ARXCOMMAND_ENTRY_AUTO(CMyHelpApp, MyGroup, ThroughAcedSetFunHelp, ThroughAcedSetFunHelp, ACRX_CMD_MODAL, NULL)
ACED_ARXCOMMAND_ENTRY_AUTO(CMyHelpApp, MyGroup, ThroughAcedHelp, ThroughAcedHelp, ACRX_CMD_MODAL, NULL)