示例#1
0
AcRx::AppRetCode
acrxEntryPoint(AcRx::AppMsgCode msg, void* pkt)
{
    switch(msg) {
    case AcRx::kInitAppMsg:
        acrxUnlockApplication(pkt);        // Try to allow unloading
        acrxRegisterAppMDIAware(pkt);

        if (acrxServiceIsRegistered("AsdkPoly") 
            && AsdkPoly::desc() != NULL
            && AcDbXmlObjectProtocol::desc() != NULL) {
            // add XML I/O protocol extension to AsdkPoly
            //
            gpPolyXmlExtension = new AcDbXmlPoly(AsdkPoly::desc());
            AsdkPoly::desc()->addX(AcDbXmlObjectProtocol::desc(), gpPolyXmlExtension);

            acrxBuildClassHierarchy();
            updateRegistry();
        }
        break;

    case AcRx::kUnloadAppMsg:
        if (acrxServiceIsRegistered("AsdkPoly") 
            && AsdkPoly::desc() != NULL
            && AcDbXmlObjectProtocol::desc() != NULL) {
            AsdkPoly::desc()->delX(AcDbXmlObjectProtocol::desc());
        }
        if (gpPolyXmlExtension)
            delete gpPolyXmlExtension;
        break;
    }
    return AcRx::kRetOK;
}
示例#2
0
extern "C" AcRx::AppRetCode
acrxEntryPoint( AcRx::AppMsgCode msg, void *pkt )
{
    switch(msg)
    {
    case AcRx::kInitAppMsg:
		//intialize AsdkAmodeler
		//
        acrxLoadModule(_T("aecmodeler50.dbx"),0);
        // Try to allow unloading
        // 
        acrxUnlockApplication(pkt);
		//register as being MDI aware
		//
		acrxRegisterAppMDIAware(pkt);
		//initialize our custom class
		AsdkBody::rxInit();
		acrxBuildClassHierarchy();
        break;

    case AcRx::kUnloadAppMsg:
		deleteAcRxClass(AsdkBody::desc());
		//unload AsdkAModeler if we have been the
		//only one using it. (RX does reference counting)
		acrxUnloadModule(_T("aecmodeler50.dbx"));
        break;
    }
    return AcRx::kRetOK;
}
示例#3
0
// Arx entry point function
//
AcRx::AppRetCode
acrxEntryPoint(AcRx::AppMsgCode msg, void* appId)
{
    switch (msg) {
    case AcRx::kInitAppMsg:
        acrxUnlockApplication(appId);
		acrxRegisterAppMDIAware(appId);
		gpAsdkAppDocGlobals = new AsdkAppDocGlobals(curDoc());
		gpAsdkAppDocGlobals->setGlobals(curDoc());
        acedRegCmds->addCommand("ASDK_NOTIFY_TEST",
            "ASDK_WATCH",
            "WATCH",
            ACRX_CMD_TRANSPARENT,
            watchDb);

        acedRegCmds->addCommand("ASDK_NOTIFY_TEST",
            "ASDK_CLEAR",
            "CLEAR",
            ACRX_CMD_TRANSPARENT,
            clearReactors);
        break;
    case AcRx::kUnloadAppMsg:
		if (gpAsdkAppDocGlobals != NULL)
		{
			gpAsdkAppDocGlobals->unload();
			delete gpAsdkAppDocGlobals;
			gpAsdkAppDocGlobals = NULL;
		}
        acedRegCmds->removeGroup("ASDK_NOTIFY_TEST");
        break;
    }
    return AcRx::kRetOK;
}
AcRx::AppRetCode 
acrxEntryPoint(AcRx::AppMsgCode msg, void* pkt)
{
	switch(msg)
	{
        case AcRx::kInitAppMsg:
			acrxUnlockApplication(pkt);
			acrxRegisterAppMDIAware(pkt);
			InitApp();
            break;
        case AcRx::kUnloadAppMsg:
			acedRegCmds->removeGroup(_T("DYNBLKAPP"));
			if (pPts)
			{
				ACRX_PROTOCOL_REACTOR_LIST_AT(AcDbBlockTableRecord::desc(), 
					AsdkInsertionPoints::desc())->removeReactor(pPts);
				delete pPts;
                pPts = NULL;
			}
            break;
        default:
            break;
    }
	return AcRx::kRetOK;
}
AcRx::AppRetCode acrxEntryPoint( AcRx::AppMsgCode msg, void *p )
{
    switch ( msg )
    {
    case AcRx::kInitAppMsg:
        acrxRegisterAppMDIAware( p );
        acrxUnlockApplication( p );
        acedRegCmds->addCommand( _T("AsdkInputPoint"), _T("AddMonitor"), _T("ADDMON"), ACRX_CMD_TRANSPARENT, cmdAddMonitor );
        acedRegCmds->addCommand( _T("AsdkInputPoint"), _T("RemoveMonitor"), _T("REMMON"), ACRX_CMD_TRANSPARENT, cmdRemoveMonitor );
        acedRegCmds->addCommand( _T("AsdkInputPoint"), _T("AddFilter"), _T("ADDFIL"), ACRX_CMD_TRANSPARENT, cmdAddFilter );
        acedRegCmds->addCommand( _T("AsdkInputPoint"), _T("RemoveFilter"), _T("REMFIL"), ACRX_CMD_TRANSPARENT, cmdRemoveFilter );
        acedRegCmds->addCommand( _T("AsdkInputPoint"), _T("ChangesOn"), _T("CHON"), ACRX_CMD_TRANSPARENT, cmdFilterChangesOn );
        acedRegCmds->addCommand( _T("AsdkInputPoint"), _T("ChangesOff"), _T("CHOFF"), ACRX_CMD_TRANSPARENT, cmdFilterChangesOff );
        acedRegCmds->addCommand( _T("AsdkInputPoint"), _T("AddReactor"), _T("ADDREAC"), ACRX_CMD_TRANSPARENT, cmdAddReactor );
        acedRegCmds->addCommand( _T("AsdkInputPoint"), _T("RemoveReactor"), _T("REMREAC"), ACRX_CMD_TRANSPARENT, cmdRemoveReactor );
        acedRegCmds->addCommand( _T("AsdkInputPoint"), _T("ForcedPickon"), _T("FPON"), ACRX_CMD_TRANSPARENT, cmdForcedPickOn );
        acedRegCmds->addCommand( _T("AsdkInputPoint"), _T("ForcedPickoff"), _T("FPOFF"), ACRX_CMD_TRANSPARENT, cmdForcedPickOff );
        acedRegCmds->addCommand( _T("AsdkInputPoint"), _T("CursorOn"), _T("CURON"), ACRX_CMD_TRANSPARENT, cmdCursorOn );
        acedRegCmds->addCommand( _T("AsdkInputPoint"), _T("CursorOff"), _T("CUROFF"), ACRX_CMD_TRANSPARENT, cmdCursorOff );
        break;

    case AcRx::kUnloadAppMsg:
        acedRegCmds->removeGroup( _T("AsdkInputPoint") );
        break;
    }
    return AcRx::kRetOK;
}
示例#6
0
AcRx::AppRetCode
ArxDbgApp::initApp()
{
    acrxUnlockApplication(m_acadAppPtr);
    acrxDynamicLinker->registerAppMDIAware(m_acadAppPtr);

        // get the name of this app so we can find where other
        // things are located.
    CString appFileName = acedGetAppName();

    char dir[_MAX_DIR], drive[_MAX_DRIVE], path[_MAX_PATH];
    _splitpath(appFileName, drive, dir, NULL, NULL);
    _makepath(path, drive, dir, NULL, NULL);
    m_appPath = path;

	CWnd* splashScreen = startSplashScreen();

    registerClasses();
    registerCommands();
    acrxBuildClassHierarchy();

    m_appServicePtr = acrxRegisterService("ArxDbgServices");

    ArxDbgAppEditorReactor::getInstance();
    MapTestReactor::getInstance();

	registerDialogExtensions();
	registerAppMenu();

	endSplashScreen(splashScreen);

    m_didInit = true;
    return AcRx::kRetOK;
}
示例#7
0
extern "C" __declspec(dllexport) AcRx::AppRetCode
acrxEntryPoint(AcRx::AppMsgCode msg, void *p)
{
    switch (msg)
    {
    case AcRx::kInitAppMsg:
        acrxRegisterAppMDIAware(p);
        acrxUnlockApplication(p);
        initApp();
        break;
    case AcRx::kUnloadAppMsg:
        unloadApp();
        break;
    }
    return AcRx::kRetOK;
}
示例#8
0
extern "C" AcRx::AppRetCode acrxEntryPoint( AcRx::AppMsgCode msg, void* pkt)
{
  switch( msg ) 
  {
    case AcRx::kInitAppMsg: 
      initApp();
      acrxUnlockApplication(pkt);
	  acrxDynamicLinker->registerAppMDIAware(pkt);
      break;
    case AcRx::kUnloadAppMsg: 
      unloadApp(); 
      break;
    default:
      break;
  }
  return AcRx::kRetOK; 
}
示例#9
0
AcRx::AppRetCode
acrxEntryPoint(AcRx::AppMsgCode msg, void* pkt)
{
    switch (msg) {
    case AcRx::kInitAppMsg:
		if (!acrxClassDictionary->at("AcBrEntity"))
			acrxDynamicLinker->loadModule("acbr16.dbx", 1);
        initModule();
        acrxUnlockApplication(pkt); // try to allow unloading
		acrxRegisterAppMDIAware(pkt);
        break ;
    case AcRx::kUnloadAppMsg:
		unloadModule();
        break ;
    default:
        break ;
    }
    return AcRx::kRetOK;
}
示例#10
0
// acrxEntryPoint(internal)
// This function is the entry point for your application.
//
AcRx::AppRetCode
acrxEntryPoint(AcRx::AppMsgCode msg, void* ptr)
{
    switch (msg) {
    case AcRx::kInitAppMsg:
        acrxUnlockApplication(ptr);
        acrxRegisterAppMDIAware(ptr);
        initApp();
        break;
    case AcRx::kUnloadAppMsg:
        unloadApp();
        break;
    case AcRx::kLoadDwgMsg:
        create_EditorReactor();
#ifdef DIRECT
        acutPrintf( "\nHardOwnership & addAcDbObject\n" );
#else
#ifdef XLATE
        acutPrintf( "\nDeepCloneXlation activated.\n" );
#else
        acutPrintf( "\nDeepCloneXlation de-activated.\n" );
#endif  // XLATE
#ifdef NOD
        acutPrintf( "Custom object will be stored in the"
            " NamedObjectsDictionary.\n" );
#else
        acutPrintf( "Custom object will be stored in the"
            " Extension Dictionary.\n" );
#endif  // NOD
#ifdef HARDPOINTER
        acutPrintf( "Entity keeps HardPointerId of custom object.\n" );
#else
        acutPrintf( "Entity keeps SoftPointerId of custom object.\n" );
#endif  // HARDPOINTER
#endif  // DIRECT
        acutPrintf( "Start with 'addobjects'.\n" );
    }
    return AcRx::kRetOK;
}
示例#11
0
AcRx::AppRetCode
acrxEntryPoint(AcRx::AppMsgCode msg, void* pkt)
{
    static AppEventCatcher* appEventCatcher = NULL;
    static void *moduleHandle;
    static HINSTANCE hDllAuto = NULL;

    switch(msg) {

    case AcRx::kInitAppMsg:

        if (!acrxLoadModule("asdkpolyobj.dbx", 0))
            return AcRx::kRetError;

        acrxUnlockApplication(pkt);		// Try to allow unloading
        acrxDynamicLinker->registerAppMDIAware(pkt);
        moduleHandle = pkt;
        // If match app server isn't present, then create and attach
        // a dynamic linker reactor to watch to see if ever loads up
        //
        if (!acrxClassDictionary->at("MatchProperties")) {
            appEventCatcher = new AppEventCatcher();
            acrxDynamicLinker->addReactor(appEventCatcher);
        }

        initModule();
        updateRegistry();

        if (!hDllAuto)
            hDllAuto = LoadLibrary("OemPolyApp.dll");
        if (hDllAuto)
        {
            HRESULT (*f)() = (HRESULT (*)()) GetProcAddress(hDllAuto, "initAutomation");
            if (f) f();
        }
        break;

    case AcRx::kUnloadAppMsg:

        if (appEventCatcher != NULL) {
            acrxDynamicLinker->removeReactor(appEventCatcher);
            delete appEventCatcher;
        }

        acedRegCmds->removeGroup("ASDK_POLYGON");
        CleanUpUserInterfaceForPolySamp();

        // If we are unloading because AutoCAD is shutting down,
        // then it's possible that the match.arx application is
        // already gone,  so we need to check to see if it's still
        // there.  If it's not,  then we can't remove the protocol
        // extension nor decrement the dependency counter.
        //
        AcRxObject* pTemp;
        if (pTemp = acrxServiceDictionary->at("MatchProperties"))
        {
            // remove the protocol extension.
            AsdkPoly::desc()->delX(AsdkPolyMatchProp::desc());
            delete pMatchPoly;

            AcRxService *pSvc = AcRxService::cast(pTemp);

            if (pSvc != NULL)
                pSvc->removeDependency();
        }

        //try to unload the object definition
        acrxUnloadModule("asdkpolyobj.dbx");

        if (hDllAuto)
        {
            HRESULT (*f)() = (HRESULT (*)()) GetProcAddress(hDllAuto, "exitAutomation");
            if (f) f();
        }
        break;
    }
    return AcRx::kRetOK;
}