Exceptions are clearly an issue. Exception handling is specific to the C++ runtime and can't be handled by other languages. This is specific to COM however, it applies to all cross language interfaces.
A COM solution would be to have all methods return a COM object (null for success if no succes return is required), which could be either a proper result object or an error object. But it would require a queryInterface to determine which. There other ways to handle this, like separate call to fetch an error object if a non-object return indicated an error, etc. > On Aug 11, 2014, at 2:29 PM, Adriano dos Santos Fernandes > <adrian...@gmail.com> wrote: > > Another requirement not yet mentioned for C++ users, are exceptions. > > While we can easily just convert IStatus to Exception, if Exception is a > FB class, not even derived from std::exception, it may be completely > inappropriate for users applications. > > You know, each C++ project has its own requirements for exceptions. > Firebird is one of them. > > In my demo (probably not need to send it, as nobody is doing concrete > arguments against it, but still talking about others things), this can > be personalized via police classes. AFAIR, this concept was created or > consolidated by Andrei Alexandrescu for the Loki library, though that > was a pure template library, not a library of interfaces. > > It consist more or less like this: > > typedef FbApi<MyPolice> MyFbApi; > MyFbApi::IInterface* interface = ...; > > This happen to work very well, even in the first implementation in the > prototype. > > > Adriano > > > ------------------------------------------------------------------------------ > Firebird-Devel mailing list, web interface at > https://lists.sourceforge.net/lists/listinfo/firebird-devel ------------------------------------------------------------------------------ Firebird-Devel mailing list, web interface at https://lists.sourceforge.net/lists/listinfo/firebird-devel