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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T00:07:48+00:00 2026-06-10T00:07:48+00:00

I’ve created a COM object with Visual Studio that I want to use with

  • 0

I’ve created a COM object with Visual Studio that I want to use with Delphi.

[Guid("9D0CCD2D-75E9-46AC-BC40-C4D84669FC45")]
[InterfaceType(ComInterfaceType.InterfaceIsIDispatch)]
public interface IMyComClassDispatch
{
    string PropertyString { get; set; }
    string funcGetString();
    void funcSetString(string aString);
}

[ClassInterface(ClassInterfaceType.None)]
public class MyComClassDispatch : IMyComClassDispatch
{
    public string PropertyString { get; set; }


    public string varString;

    public string funcGetString()
    {
        return varString;
    }

    public void funcSetString(string aString)
    {
        varString = aString;
    }
}

Then I’ve generated the tlb file, and finally a pascal file corresponding to my COM object with tlibimp.exe bundled with Delphi 5:

C:\>tlibimp.exe -P+ mylib.tlb

and here is the generated code:

// *********************************************************************//
// DispIntf:  IMyComClassDispatch
// Flags:     (4096) Dispatchable
// GUID:      {9D0CCD2D-75E9-46AC-BC40-C4D84669FC45}
// *********************************************************************//
  IMyComClassDispatch = dispinterface
    ['{9D0CCD2D-75E9-46AC-BC40-C4D84669FC45}']
    property PropertyString: WideString readonly dispid 1610743808;
    function  funcGetString: WideString; dispid 1610743810;
    procedure funcSetString(const aString: WideString); dispid 1610743811;
  end;

The problem is that my property is marked as read only and I don’t really see why that is happening, because this tool can also generates C++ code and the property can be modified:

// *********************************************************************//
// Interface   : IMyComClassDispatch
// Indicateurs : (4096) Dispatchable
// GUID        : {9D0CCD2D-75E9-46AC-BC40-C4D84669FC45}
// *********************************************************************//
interface IMyComClassDispatch : public TDispWrapper<IDispatch>
{
  BSTR __fastcall get_PropertyString()
  {
    _TDispID _dispid(/* PropertyString */ DISPID(DISPID_UNKNOWN/*[1610743808]*/));
    TAutoArgs<0> _args;
    OlePropertyGet(_dispid, _args);
    return _args.GetRetVariant();
  }

  void __fastcall set_PropertyString(BSTR Param1/*[in]*/)
  {
    _TDispID _dispid(/* PropertyString */ DISPID(1610743808));
    TAutoArgs<1> _args;
    _args[1] = Param1 /*[VT_BSTR:0]*/;
    OlePropertyPut(_dispid, _args);
  }

  BSTR __fastcall funcGetString()
  {
    _TDispID _dispid(/* funcGetString */ DISPID(DISPID_UNKNOWN/*[1610743810]*/));
    TAutoArgs<0> _args;
    OleFunction(_dispid, _args);
    return _args.GetRetVariant();
  }

  void __fastcall funcSetString(BSTR aString/*[in]*/)
  {
    _TDispID _dispid(/* funcSetString */ DISPID(DISPID_UNKNOWN/*[1610743811]*/));
    TAutoArgs<1> _args;
    _args[1] = aString /*[VT_BSTR:0]*/;
    OleProcedure(_dispid, _args);
  }


  __property   BSTR            PropertyString = {read = get_PropertyString, write = set_PropertyString};
};

Does this means that I should avoid properties with COM objects or is there any options that I should change ? Is this a problem with tlibimp or a limitation of the compiler that cannot generate instructions to write on COM objects properties ?

Any help would be appreciated on this!

  • 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-10T00:07:50+00:00Added an answer on June 10, 2026 at 12:07 am

    This is known defect in Delphi 5 & 6 tlibimp.exe. You shall upgrade to Delphi 7 or newer version to avoid it.

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

Sidebar

Related Questions

I have a French site that I want to parse, but am running into
I want use html5's new tag to play a wav file (currently only supported
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I am trying to understand how to use SyndicationItem to display feed which is
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I want to count how many characters a certain string has in PHP, but
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace
I am doing a simple coin flipping experiment for class that involves flipping a

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.