• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Getting an "Unhandled exception" when adding a FlyouToolBar to a ToolBarButton [Acrobat Pro DC]

New Here ,
Oct 08, 2020 Oct 08, 2020

Copy link to clipboard

Copied

Hi experts,

 

I'm getting an "Unhandled exception at 0x772ECE50 (ucrtbase.dll)" when I run my plugin. I need to add 2 buttons in a flyout toolbar attached to the main Toolbutton but I always get that error.

 

Here is my code:

static void SetUpToolButton(void)
{

// Creating the main ToolButton
//CreateIcons();
stamperToolButton = AVToolButtonNew(Stamper_K, NULL, false, false);

//creating the Opt subtoolbuttons
OPT1SubToolButton = AVToolButtonNew(ASAtomFromString("OPT_1"), NULL, false, false);
OPT2SubToolButton = AVToolButtonNew(ASAtomFromString("OPT_2"), NULL, false, false);

//creating the flyoutToolbar
AVToolBar flyoutToolbar = AVToolBarNewFlyout();

//adding the opt subtoolbuttons to the flyoutToolbar
AVToolBarAddButton(flyoutToolbar, OPT1SubToolButton, false, NULL);
AVToolBarUpdateButtonStates(flyoutToolbar);
AVToolBarAddButton(flyoutToolbar, OPT2SubToolButton, false, NULL);
AVToolBarUpdateButtonStates(flyoutToolbar);

//Attaching the flyoutToolbar to the main Toolb
AVToolButtonSetFlyout(stamperToolButton, flyoutToolbar);

//AVToolButtonSetExecuteProc (stamperToolButton, cbActivateStamperTool, NULL);
//AVToolButtonSetComputeEnabledProc (stamperToolButton, cbStamperIsEnabled, (void *)pdPermEdit);
//AVToolButtonSetComputeMarkedProc (stamperToolButton, cbStamperIsMarked, NULL);
//AVToolButtonSetHelpText (stamperToolButton, "Stamper");

//Creating the main toolbar 
AVToolBar toolBar = AVToolBarNew("Stamper", "Stamper");
//AVToolBarSetIcon(toolBar, gIcons[0], gIcons[1]);

AVToolBarAddButton(toolBar, stamperToolButton, false, NULL);
AVToolBarUpdateButtonStates(toolBar);
}

 

Any help would be greatly appreciated.

 

Regards,

Febo.

TOPICS
Acrobat SDK and JavaScript

Views

407

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 09, 2020 Oct 09, 2020

Copy link to clipboard

Copied

Is this in a computer with AutoCAD?

 

In which version of  Adobe Acrobat Pro and operating system is this happening? Are they both updated to latest version updates?

 

Does the toolbar need to access any type of protected files in a netowrked environment?

 

I would say to try an update your Visual Studio and/or upgrade its version.

 

Also see if lack updating  Visual C++ redistributables, or similar, is causing the issue.

 

Whatever program is calling the for  ucrtbase.dll to load itself up, it is not finding the appropriate registration module. In which case, it makes me wonder if i this related to a 32 bit versus 64 bit plug-in compatibility issue.

 

If you're installing a third-party plug-in to interact with Acrobat in a MS Windows environment,  re-check the release notes and see if there's any known compatibility issues (or support) between 32bit versus 64bit plug-in version. 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 09, 2020 Oct 09, 2020

Copy link to clipboard

Copied

Hi ls_rbls,

 

Thank you for your quick reply! Regarding your questions:

 

Is this on a computer with AutoCAD? -> Nope.
In which version of Adobe Acrobat Pro and operating system is this happening? Are they both updated to latest version updates? -> Acrobat DC Pro 2020.012.20048 and Windows 10 Pro 2004. 
Does the toolbar need to access any type of protected files in a networked environment? ->Nope.

I would say to try to update your Visual Studio and/or upgrade its version.-> I'm using the suggested version: MS Visual Studio Ultimate 2013 Version 12.0.40629.00 Update 5 (2015). Is that okay or what version should I use?

If you're installing a third-party plug-in to interact with Acrobat in a MS Windows environment... -> Nope, I'm not using any third-party plug-in.

 

I make some tests creating another project with just the flyoutToolBar code (the same code above). I compiled the .api plugin and tested it on another fresh computer (Acrobat DC Pro 2020.012.20048 and windows 10 Pro 2004) getting the same result. Once I place the .api and execute Acrobat DC, two things may happen: 1. it just doesn't run OR (rarely) 2. it runs but it does not show the correct button arrange. When I run the debugger is when I get the ucrtbase.dll error.

Capture.JPG

Regards,

Febo.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 17, 2020 Oct 17, 2020

Copy link to clipboard

Copied

LATEST

From additional reading I just learned that this problem can be traced back to the days of MS Windows 7.

 

ucrtbase.dll  is a component if the Visual C++ redistributables. In the case of MS Windows 7, for example, this issue used to be resolved by updating the service packs (SP), specifically SP1.

 

That being the logic, it seems that your MS Windows 10 build need to update a component of the Visual Sutdio or a C++ redistributable in order to be able to load up ucrtbase.dll correctly when your application calls for it.

 

Were you able to work around this yet?

 

To answer your question: MS Visual Studio Ultimate 2013 Version 12.0.40629.00 Update 5 (2015). Is that okay or what version should I use?

 

Yes, if it was up to me I would probably would even test by rolling back to an older version (and see if that is what your APIs are requiring) or upgrade completely to the 2019 version which is featuring code cleanup, and Git repositories integration.  

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines