How to add double click processing protocol in the "On_kInitAppMsg" function(AcDbDoubleClickEdit)

I now need to implement a function of double clicking a specific block response. I inherited the class "CFrameDoubleClick" from "AcDbDoubleClickEdit" to implement double clicking response. But I'm "On_kInitAppMsg (void * PKT)" add double-click an error when processing agreement, I add the function of the agreement as follows "AcDbDoubleClickEdit: : rxInit ();
CFrameDoubleClick* pContactEdit = new CFrameDoubleClick;
AcDbBlockReference::desc()->addX(AcDbDoubleClickEdit::desc(), pContactEdit);” Display error :LNK2019????????? "__declspec(dllimport) public: static void __cdecl AcDbDoubleClickEdit::rxInit(void)" (_imp? rxInit@AcDbDoubleClickEdit@@SAXXZ),?? "public: virtual enum AcRx::AppRetCode __cdecl CMSDApp::On_kInitAppMsg(void *)" (? On_kInitAppMsg@CMSDApp@@UEAA? AW4AppRetCode@AcRx@@PEAX@Z),

How do I add a protocol for double click processing to the "On_kInitAppMsg" function(version bricacad 2024)

Comments

  • Its_Alive
    edited June 28

    you have to create your class

    class AcDbDoubleClickBlockReference : public AcDbDoubleClickEdit
    {
    public:
        AcDbDoubleClickBlockReference() = default;
        virtual ~AcDbDoubleClickBlockReference() override = default;
    
        virtual void finishEdit(void) override
        {
            acutPrintf(_T("\nfinishEdit: "));
        }
        virtual void startEdit(AcDbEntity* pEnt, AcGePoint3d pt) override
        {
            acutPrintf(_T("\nstartEdit: "));
        }
    };
    

    then

    class AcRxPyApp : public AcRxArxApp
    {
        std::unique_ptr<AcDbDoubleClickBlockReference> pRefClick;
    public:
        AcRxPyApp() : AcRxArxApp()
        {
        }
    
        virtual AcRx::AppRetCode On_kInitAppMsg(void* pkt) override
        {
            AcRx::AppRetCode retCode = AcRxArxApp::On_kInitAppMsg(pkt);
    
            pRefClick.reset(new AcDbDoubleClickBlockReference());
            AcDbBlockReference::desc()->addX(AcDbDoubleClickEdit::desc(), pRefClick.get());
    
            return (retCode);
        }
    
    

    note, you will have to remove all the double click actions from the CUI as they are called first

  • ***remove all the double click actions from the CUI as they are called first

    should read all the double click actions that are relevant to block refs

  • I tried it the way you did, but there was no response when I double-clicked a block, and it always felt like I was missing a process to initialize AcDbDoubleClickEdit

  • yeah, it’s not really a useful tool anymore because the CUI fires first, blocking your action. Maybe you can replace the ddedit command or use events

  • Thank you very much. I've decided to take another option