[SOLVED] Handler not called
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2015-08-02
08:35 PM
- last edited on
2023-07-13
03:44 PM
by
Doreena Deng
2015-08-02
08:35 PM
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:
I'm using VS 2010 SP1 & Windows 7 & ArchiCAD 18 (build 3006) in demo mode.
Here is my RegisterInterface, Initialize and MenuCommandHandler functions:
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:
'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.
Labels:
- Labels:
-
Add-On (C++)
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2015-08-02 09:04 PM
2015-08-02
09:04 PM
Found it while writing my post. I was using Dev Kit 19 with ArchiCAD 18! On MyArchiCAD, it's the 18 version which is available. After changing path to Dev Kit 18, it's working.