2018-10-03 12:26 PM - last edited on 2022-10-06 01:05 PM by Daniel Kassai
Solved! Go to Solution.
2018-10-05 01:23 PM
Hai wrote:So, in your RegisterInterface() function:
Hi Ralph,
Thank you so much but I'm a beginner and sorry I don't understand where menu handler is.
GSErrCode __ACENV_CALL RegisterInterface (void) { ACAPI_Register_Menu (32500, 0, MenuCode_UserDef, MenuFlag_Default); return NoError; } // RegisterInterfaceHere 32500 is the ID of the string resource that appears in the menu; add this to the .grc file:
'STR#' 32500 "Strings for the Menu" { /* [ 1] */ "Hello world" }Then in your Initialize() function add the following:
GSErrCode __ACENV_CALL Initialize (void) { GSErrCode err = ACAPI_Install_MenuHandler (32500, MenuCommandHandler); // other stuff }Last, in your MenuCommandHandler function call Do_CreateHelloWord():
GSErrCode __ACENV_CALL MenuCommandHandler (const API_MenuParams *params) { if (params->menuItemRef.itemIndex == 1) { Do_CreateHelloWord (); } }
2018-10-03 04:08 PM
2018-10-04 03:59 AM
kzaremba wrote:I'm using VS 2017 but I don't know how to start with Hello World Blog. How can I use that code and necessary resource to get Hello World in AC. Could you show me how to do it step by step? Thanks for your kind.
It would be good to have one for Visual Studio as well. So you can start project instantly on custom path.
2018-10-04 10:34 AM
// ----------------------------------------------------------------------------- // DoCommand // called to perform the user-asked command // ----------------------------------------------------------------------------- GSErrCode __ACENV_CALL MenuCommandHandler (const API_MenuParams *params) { if (params->menuItemRef.itemIndex == 1) { //Your code here } return NoError; } // MenuCommandHandler
2018-10-04 04:49 PM
2018-10-04 06:17 PM
Hai wrote:Search the project for
Thank you so much but I'm a beginner and sorry I don't understand where menu handler is.
2018-10-05 01:23 PM
Hai wrote:So, in your RegisterInterface() function:
Hi Ralph,
Thank you so much but I'm a beginner and sorry I don't understand where menu handler is.
GSErrCode __ACENV_CALL RegisterInterface (void) { ACAPI_Register_Menu (32500, 0, MenuCode_UserDef, MenuFlag_Default); return NoError; } // RegisterInterfaceHere 32500 is the ID of the string resource that appears in the menu; add this to the .grc file:
'STR#' 32500 "Strings for the Menu" { /* [ 1] */ "Hello world" }Then in your Initialize() function add the following:
GSErrCode __ACENV_CALL Initialize (void) { GSErrCode err = ACAPI_Install_MenuHandler (32500, MenuCommandHandler); // other stuff }Last, in your MenuCommandHandler function call Do_CreateHelloWord():
GSErrCode __ACENV_CALL MenuCommandHandler (const API_MenuParams *params) { if (params->menuItemRef.itemIndex == 1) { Do_CreateHelloWord (); } }
2018-10-05 07:27 PM
Ralph wrote:Thank you very much. I will learn it and reply for result as soon.
Search the project forMenuCommandHandler. For that particular project, it's in the file AddOnObject_Manager.cpp
2018-10-05 07:32 PM