Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8973755
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T18:31:21+00:00 2026-06-15T18:31:21+00:00

I have a custom COM server implementation. The server is using a TComObjectFactory to

  • 0

I have a custom COM server implementation. The server is using a TComObjectFactory to create the COM objects that are used for client connections.

I had written it like this:

function TPsOPCProviderClientFactory.CreateComObject(const Controller:
    IUnknown): TComObject;
begin
  FStartupCompleteEvent.WaitFor(INFINITE);
  if Provider.State = OPC_STATUS_SUSPENDED then // Server already shutdown
    raise EAbort.Create('Server shut down.');
  Result := inherited CreateComObject(Controller);
  (Result as TPsOPCProviderClient).Provider := Provider;
end;

The FStartupCompleteEvent is used to ensure that the application is ready before the first connection is let through and the Provider.State is used to disable client connections when the server is going to shut down.

Now it appears that this is not the proper way to cancel the object creation: if the exception is raised it will make a message dialog with “DAX Error” popup on the screen and the client may crash.

What is the correct way to make the object creation fail – or is it compulsory to always succeed?

The code is used in a component framework that is available for all Delphi/C++Builder versions since Delphi 5.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T18:31:22+00:00Added an answer on June 15, 2026 at 6:31 pm

    You shouldn’t let any exception escape from your DllGetClassObject COM entry point.
    Instead you should trap this exception and return an appropriate HResult value (possibly E_UNEXPECTED).

    It could look similar to this:

    function DllGetClassObject(const CLSID, IID: TGUID; var Obj): HResult;
    begin
      try
        Result := ComServ.DllGetClassObject(CLSID, IID, Obj);
      except
        Pointer(Obj) := nil;
        Result := E_UNEXPECTED;
      end;
    end;
    

    Edit: Alternatively, it would be simpler to modify your CreateComObject method to return nil instead of raising an exception. The default DllGetClassObject implementation in ComServ will return CLASS_E_CLASSNOTAVAILABLE in that case.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using http://dev.sencha.com/deploy/ext-4.0.7-gpl/examples/portal/portal.html to build a portal. Obviously, i have custom windows inside
So I have this page that has some basic custom tabs: http://demo.unlockedmanagement.com/users/view/2 * NOTE
I am using Microsoft-IIS/7.5 on a hosted server (Hostek.com) I have an existing site
I have to call a WS that requires custom client authentication. This authentication is
We have custom cms that currently sits on a vendor's subdomain, such as cms.vendor.com.
I have the following custom event: package com.un.photoManager.events { import flash.events.Event; import mx.collections.ArrayCollection; public
I have setup Custom Domain https://developers.google.com/appengine/docs/domain I have uploaded An SSL certificate and private
Here is my page: http://budclarychevy.com/custom/parts-specials-test My aim is to have the images clickable and
I have a custom base user control in silverlight. <UserControl x:Class=Problemo.MyBaseControl xmlns=http://schemas.microsoft.com/winfx/2006/xaml/presentation xmlns:x=http://schemas.microsoft.com/winfx/2006/xaml xmlns:d=http://schemas.microsoft.com/expression/blend/2008
Let's say I have myapp.appspot.com and two custom domains respectively called foo.com and bar.com

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.