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 4080384
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T17:55:24+00:00 2026-05-20T17:55:24+00:00

There is a bug in a third party .DLL file that we’re using and

  • 0

There is a bug in a third party .DLL file that we’re using and I’ve been assigned to fix it. The library was made by the company last hired to maintain the code and we only have some of the source code. Whenever the objects used for processing are in the code we have, they’re in the form of OleVariants. My solution was to create a subclass of the one with the bug and override the method to correct the bug. The problem is that whenever I try calling a method from the parent class I get a Memory Access Violation error from a different .DLL file.

I’m a complete Delphi newbie with this being my third week working with it. Any help would be appreciated.

Thank You.

EDIT: I should probably elaborate a bit more. I’m replacing the original object with an instance of the new class which has the fix in it. I’m trying to cast the original object from OleVariant up to either the new class and recast it down or pass it to the constructor for the new object so I can maintain the data in the object. I’m wondering if there’s a way to do this and not have an error when I either call the inherited function or the function from the object after it has been cast back up to its original type. Thank you again.

EDIT 2: To answer one question, I’m trying to cast from the OleVariant to it’s original class or to the subclass I created.

To answer the second question: I imported the library involved then wrote the following:

Subclass = class(SuperclassFromDll)

Where “Subclass” and “SuperclassFromDll” are the actual class names. If this isn’t the right way to do it, please tell me how to replace the function in question (possibly by writing the fix into the DllName_TLB unit?). Sorry for any lack of clarity, I’m trying to ask the question quickly so I can get back to trying to figure it out.

EDIT 3: I should also note that the DLL file was created from a Delphi project made by the previous company.

  • 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-05-20T17:55:25+00:00Added an answer on May 20, 2026 at 5:55 pm

    You can’t do this. As David Heffernan says it is “non-trivial”, which is a nice way of saying you would have to be a genius to pull it off. So you need to not be a Delphi newbie if you are going to attempt it. (OTOH, If you were not a delphi newbie you wouldn’t even consider it).

    For one thing you will only be able to cast a COM object to a Delphi object if the COM object is implemented in Delphi, AND dynamically linked, AND compiled with the same version of Delphi.

    A better, simpler solution, since the problem reportedly occurs when you call the method on the class, is to isolate the circumstances which give rise to the problem, and avoid calling the method in those circumstances.

    You can do that in a wrapper class. So rather than casting the OleVariant (I assume COM object under the hood) and casting that to a delphi wrapper class, create your own class CProblemObjectShim which has the problem class as a member. Then implement ALL the methods by calling the contained object, and adding the additional checks or steps neccessary to work around the problem.

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

Sidebar

Related Questions

A third party is sending us a flat file that is supposed to contain
I came across an issue that makes me think there is bug in the
I have a program that needs several third-party libraries, and at the moment it
Ours is an upcoming company, so we cannot buy two three third party controls
Is there any good bug tracker based on .NET which is free?
I assumed there were only bug fixes/(no new types) in .NET 2.0 SP1 until
Just flicking through one of my favourite books (Ellen Ullman's The Bug) and there
We're working on a device driver for Vista. There's a known bug in SPO
There is a conversion process that is needed when migrating Visual Studio 2005 web
At my previous employer we used a third party component which basically was just

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.