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

  • SEARCH
  • Home
  • 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 7603929
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T23:46:37+00:00 2026-05-30T23:46:37+00:00

After importing into delphi the com dll file, the delphi in turn generated a

  • 0

After importing into delphi the com dll file, the delphi in turn generated a lib_tlb.pas file.

Inspecting the file it shows

Iinterface1 = interface(IDispatch)
    function func: Integer; safecall;
    procedure proc(param:Iinterface1);
end;

Cointerface1 = class
  class function Create: Iinterface;
  class function CreateRemote(const MachineName: string): Iinterface1;
end;

Tinterface1 = class(TOleServer)
    function func: Integer;
    procedure proc(param:Iinterface1);
end;

Now its clear to see that there is no connection between Tinterface1 and Iinterface1.

The problem comes when one calls proc with an Tinterface1. this will not compile Tinterface1 does not inheritce Iinterface1.

So what suggested to do? change the lib that is auto generated? or do you have a better idea of what to do when wanting to pass Tinterface1 to proc.

The example is a simplification of the code, in the code there is anther object that needs to be the one to be passed to proc, however that proc knows only its interface, which is the same problem.

update: as it seems the manual of the com dll file, says that proc should be

    procedure proc(param:^Tinterface1);

where the interface is only in delphi point of view.

  • 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-30T23:46:38+00:00Added an answer on May 30, 2026 at 11:46 pm

    TInterface1.Proc() is expecting a pre-existing IInterface1 object to be passed to it as input. Use Cointerface1.Create() to create that object, eg:

    var
      intf: Iinterface1;
    begin
      intf := Cointerface1.Create;
      TheOleServerInstance.proc(intf);
    end;
    

    Tinterface1 is a TOleServer descendant that does not directly inherit from Iinterface1 (but it does wrap an Iinterface1 internally), so you have to cast it whenever you want to pass it where an Iinterface1 is expected, eg:

    var
      intf: Iinterface1;
      svr: Iinterface1;
    begin
      intf := Cointerface1.Create;
      if Supports(TheOleServerInstance, Iinterface1, svr) then
        intf.proc(svr);
    end;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I made the mistake of modifying my original source after importing it into subversion.
I am importing data from a flat file into a normalized table structure. I
So the file I am importing into a ListBox looks like this (each newline
Forum- After an importing a previously working package into my Eclipse IDE All of
I have a 1GB sql text file I'm importing into MySQL. I've used a
After cloning playframework from github and importing java sources into eclipse there are a
I'm importing Oracle data into SQL Server. After my OLE DB Source that runs
After importing content from a legacy website using the Feeds module, I'm left with
When I type 'from' (in a LINQ query) after importing System.Linq namespace , it
After installing the VSTS Database GDR and importing a SQL Server 2005 database that

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.