Author:mdelanno
Posted: Sun Aug 02, 2015 7:35 pm (GMT+1)
I've successfully created an addon with the VS wizard. The addon loads itself in ArchiCAD and I see my menu in the Tools main menu. But when I click on my menu item (Sample menu), nothing happens.
Here is my RegisterInterface, Initialize and MenuCommandHandler functions:
My ACAddOn1.grc file:
If I put breakpoints in RegisterInterface and Initialize, I see they are well executed and NoError is returned. But my breakpoint in MenuCommandHandler is never hit. And there is no output.
I'm using VS 2010 SP1 & Windows 7 & ArchiCAD 18 (build 3006) in demo mode.
Posted: Sun Aug 02, 2015 7:35 pm (GMT+1)
I've successfully created an addon with the VS wizard. The addon loads itself in ArchiCAD and I see my menu in the Tools main menu. But when I click on my menu item (Sample menu), nothing happens.
Here is my RegisterInterface, Initialize and MenuCommandHandler functions:
Code: |
GSErrCode __ACENV_CALL RegisterInterface (void) { GSErrCode err = ACAPI_Register_Menu (32500, 32520, MenuCode_Tools, MenuFlag_Default); if (err != NoError) DBPrintf ("ACAddOn1:: RegisterInterface() ACAPI_Register_Menu failed\n"); return err; } GSErrCode __ACENV_CALL Initialize (void) { GSErrCode err = ACAPI_Install_MenuHandler (32500, MenuCommandHandler); if (err != NoError) DBPrintf ("ACAddOn1:: Initialize() ACAPI_Install_MenuHandler failed\n"); return err; } GSErrCode __ACENV_CALL MenuCommandHandler (const API_MenuParams *menuParams) { DBPrintf ("ACAddOn1::MenuCommandHandler() %d/%d\n", menuParams->menuItemRef.menuResID, menuParams->menuItemRef.itemIndex); return NoError; } |
My ACAddOn1.grc file:
Code: |
'STR#' 32500 "Menu strings" { /* [ 1] */ "Sample menu" } 'STR#' 32520 "Status bar strings" { /* [ 1] */ "Sample" } |
If I put breakpoints in RegisterInterface and Initialize, I see they are well executed and NoError is returned. But my breakpoint in MenuCommandHandler is never hit. And there is no output.
I'm using VS 2010 SP1 & Windows 7 & ArchiCAD 18 (build 3006) in demo mode.