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

uncaught exception can't be catched

Community Beginner ,
Jul 26, 2016 Jul 26, 2016

Copy link to clipboard

Copied

I have integrated the sources of the xmlcataloghandler sample into my CS2 Plug-In.

The sample can't be build at CS2, due to missing 'Types.r' athough I build my plug-In for WIN32.

The SDKFileHelper I want to call from an own menu item.

The Plug-In can be build without any error, but when I invoce the functionality

to read the XML-File, I get permanently the message 'Adobe InDesign is shutting

down. A serious error was detected' at the line 'IDFile defaultCatalogFile =

Utils<IXCatHndFacade>()->GetDefaultXMLCatalogFile();'
Further I'v surrounded that line with a try-clause and catch (const exception& e).
The method GetDefaultXMLCatalogFile() itself I've also surrounded with a
try/catch-clause.
But anyway I get the named uncaught error, which will stop InDesign.
What to do to avoid or to handle that basic error?

Jochen Seliger

TOPICS
SDK

Views

1.2K

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

correct answers 1 Correct answer

Guide , Jul 27, 2016 Jul 27, 2016

Fine that you sorted out that problem.

Please remember to mark this discussion as answered.

Votes

Translate

Translate
Guide ,
Jul 26, 2016 Jul 26, 2016

Copy link to clipboard

Copied

In C++ accessing NULL does not throw an exception, it crashes the program. If I remember that correctly, with CS2 exceptions had to be disabled in the compiler anyway, so forget about exceptions.

To verify, add the line:

if( !Utils<IXCatHndFacade>().Exists() ) CAlert::ErrorAlert(PMString(".Nüscht"));

If you see the error dialog, your .fr class definition resource is missing the matching AddIn at kUtilsBoss.

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 Beginner ,
Jul 26, 2016 Jul 26, 2016

Copy link to clipboard

Copied

Hi Dirk,

seems that you are on the right way.

The Alert 'Nüscht' ist thrown, because the Facade-object dos not exist.

But the obviousely required implementation at my and at the samples fr-file iss missing.

Could you please let me know, which lines shoul den added at least to my UIE.fr-file?

You may reach me directly via jochen.seliger@flowcontrol.org.

Regards

Jochen Seliger

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 Beginner ,
Jul 26, 2016 Jul 26, 2016

Copy link to clipboard

Copied

Hi Dirk,

I'v found the Addin for KUtilsBoss at the Boss definition of kUIEXCatHndChangeEntityMappingCmdBoss

with the line IID_IXCATHNDFACADE,    kXCatHndFacadeImpl.

At my UIEID.h-file I'v the line:

DECLARE_PMID(kImplementationIDSpace, kXCatHndFacadeImpl, kUIEPrefix + 1 )

At my UIEFactoryList.h I've the line:

REGISTER_PMINTERFACE(XCatHndFacade, kXCatHndFacadeImpl)

But I get still the Alert for missing Facade-object.

What is missing?

Jochen Seliger

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 Beginner ,
Jul 26, 2016 Jul 26, 2016

Copy link to clipboard

Copied

Hi Dirk,

I've checked all the implementations as done at the sample and have

UIE.fr

at kUtilsBoss,

IID_IXCATHNDFACADE,    kXCatHndFacadeImpl,

UIEID.h

DECLARE_PMID(kInterfaceIDSpace, IID_IXCATHNDFACADE, kUIEPrefix + 5)

DECLARE_PMID(kImplementationIDSpace, kXCatHndFacadeImpl, kUIEPrefix + 1 )

UIEFactoryList.h

REGISTER_PMINTERFACE(XCatHndFacade, kXCatHndFacadeImpl)

XCatHndFacade.cpp

CREATE_PMINTERFACE(XCatHndFacade, kXCatHndFacadeImpl)

What is missing here?

Jochen

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 Beginner ,
Jul 26, 2016 Jul 26, 2016

Copy link to clipboard

Copied

Hi Dirk,

the problem was the namig of the UtilsBoss.

After renamingit to kUtilsBoss, the error is over.

Thanks

Jochen

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
Guide ,
Jul 27, 2016 Jul 27, 2016

Copy link to clipboard

Copied

LATEST

Fine that you sorted out that problem.

Please remember to mark this discussion as answered.

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