Am creating a Plug-in for for using the Acrobat XI SDK.
Am using the following code to add a Button to the File toolbar but i seem not to see the button.
const char * toolbarName= "File" ;
DURING
//Retrieve the File toolbar
AVToolBar myToolBar = AVAppGetToolBarByName(toolbarName);
//Create an AVIcon object
AVIcon myIcon = (AVCursor)LoadBitmap(gHINSTANCE, MAKEINTRESOURCE(IDB_BITMAP1));
//Create a new button
MyButton = AVToolButtonNew(ASAtomFromString("AGBP:PDFSaveButton"), myIcon, false, false);
//Set a button's help text
const char * helpText = "Startet die DCT-Auftragsdatenzuordnung" ;
AVToolButtonSetHelpText (MyButton, helpText);
//Create an ASConstText object by using a ASText object
ASText tmpText = ASTextNew();
ASTextSetPDText(tmpText, "Plug-InButton Text");
ASConstText labelText = tmpText;
//Set the button’s label text with a kAVButtonPriorityOnNormal priority
AVToolButtonSetLabelText (MyButton, labelText, kAVButtonPriorityOnNormal);
//Expose the button in a web browser
AVToolButtonSetExternal(MyButton, TOOLBUTTON_EXTERNAL | TOOLBUTTON_INTERNAL);
//Create toolbar button callback
AVToolButtonSetExecuteProc (MyButton, ASCallbackCreateProto(AVExecuteProc, buttonCommand), NULL);
AVToolButtonSetComputeEnabledProc (MyButton, ASCallbackCreateProto(AVComputeEnabledProc, buttonCommandEnabled), (void *)pdPermEdit);
//Attach the button
AVToolBarAddButton(myToolBar, MyButton, true, NULL);
//Call AVToolBarUpdateButtonStates() after adding a button to update the toolbar.
AVToolBarUpdateButtonStates(myToolBar);
HANDLER
AVAlertNote("Something went wrong!!!");
END_HANDLER
Everything seems to be fine. I get an AVToolBar, the icon is not NULL, myButton is also not NULL.
But still i see no button. What am i doing wrong?