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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T20:46:45+00:00 2026-05-29T20:46:45+00:00

we have a delphi application which contains a TXTextControl (v. 13.0). This application uses

  • 0

we have a delphi application which contains a TXTextControl (v. 13.0).
This application uses a C++ DLL (written with visual studio 2008) in order to process speech recognition. When the DLL is initialized, the DispatchInterface of the TXTextControl is passed from delphi application to the DLL and stored for later use.
When an event of text recognition is received within the DLL code, the IDispatch interface reference to the TXTextControl is used to invoke the method setText on the the text control as follow:

  try{
    CString val(text.c_str());
    this->_txtInterface.SetSelLength(0);
    this->_txtInterface.SetSelText(val);
  }catch(...){
    LOG4CXX_FATAL(getLogger(), "COM exception!");
  }

  LOG4CXX_DEBUG(getLogger(), "OK");

where _txtInterface is the TXTextXontrol interface stored when DLL has been initialized.

But when the interface is invoked, nothing happen and the following loge instruction code is not executed. It seems that the IDispatch interface is no more valid.

Within delphi the idispatch interface is passed with following code during DLL initialization:

tmpRedit := TTxtextcontrol(tmpvocField.obj);
ires := gst.CreateNewDocument( tmpvocfield.DocID , tmpRedit.DefaultInterface , '');

where “tmpvocField.obj” is the reference to the TXTextControl within delphi.

What could be the problem?
Is this a threading problem? I mean the TXTextControl is in thread 1 but the text recognition event is in a different thread (thread 2) so the idispatch is no more valid in the second thread?

Thanks for any response.
Paolo.

  • 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-29T20:46:47+00:00Added an answer on May 29, 2026 at 8:46 pm

    In c++ there is no automatic reference counting like Delphi does for interfaces.
    You need to call AddRef to make sure the refcount is at least 1.

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

Sidebar

Related Questions

I have an application written in Delphi 7 which does not require an admin
I have a Delphi application which contains a manifest file with a few dependencies
I am using Delphi 7 on Windows 7 and have an application which uses
We have a large (about 580,000 loc) application which in Delphi 2006 builds (on
I have to resurrect an ancient Delphi 7 application, which means I have to
I have a Delphi application similar to Taskbar Shuffle that includes a hook dll.
I have a process that currently runs in a Delphi application that I wrote
I have a very simple problem. I have an application which is written in
I have a Delphi DLL that contains the following types: type TStepModeType = (smSingle,
I'm in the process of converting a Paradox database application written in Delphi to

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.