Watch, Follow, &
Connect with Us
Public Report
Report From: Delphi-BCB/RTL/Delphi/Thread support    [ Add a report in this area ]  
Report #:  21410   Status: Withdrawn
CoCLasses fail queryinterface when created in thread
Project:  Delphi Build #:  8.1
Version:    7.0 Submitted By:   Bill McMahon
Report Type:  Crash / Data loss / Total failure Date Reported:  11/14/2005 4:29:27 PM
Severity:    Critical / Show Stopper Last Updated: 4/21/2006 3:45:05 PM
Platform:    All versions Internal Tracking #:  
Resolution: None  Resolved in Build: : None
Duplicate of:  None
Voting and Rating
Overall Rating: No Ratings Yet
0.00 out of 5
Total Votes: 1
This is a simple test case that exhibits the same behavior as a large app I'm trying to release. There are two CoClasses, Foo & Bar. The Foo CoClass has two properties that return the Bar CoClass. The project is conditionalized to either create the second instance of Bar within the main thread or a worker thread. When compile w/o threads, a client such as a VBScript can access the second instance of Bar & a simple string property. When compiled for the thread, VBScript complains that the second instance is not an object. Using COMTrace utility, it show that the queryinterface for second Bar fails.
I'm attaching test case & simple script that demonstrates the problem
Steps to Reproduce:
Project is conditionaly compiled for threads & no threads. When compiled for no threads the vbs script works as expected. When compiled for threads, the script fails for the second Bar property. COMTrace shows the queryinterface failing for the thread created Bar class.

Bill McMahon at 4/21/2006 3:45:00 PM -
I'm with drawing this report. I determined that the probel was in the event code that the app used. However I'm very disappointed that an issue submitted as a critical bug received no attention/response.  Any need to upgrade to a newer development environment will be to MS c#

Server Response from: ETNACODE01