Solved

Delphi MIDAS and threaded client requests

Posted on 1998-11-19
2
511 Views
Last Modified: 2006-11-17
Hi,

I am writing a report server using D3 MIDAS and want a thread in the client to handle the DCOM requests. I want the thread to send the requests from a que one at a time and wait for a response on the server. This way the client can still submit further requests without being "held up" with the current request running.

I wrote this and got it working without threads. Now I am trying to thread the MIDAS requests and whenever I call a method on the application sever in the execute code of my thread I get.

EOleSysError : Coinitialize has not been called.

Can you send MIDAS calls in a background thread from the client ? and if so How ?



0
Comment
Question by:yort1
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 

Author Comment

by:yort1
ID: 1347379
Edited text of question
0
 
LVL 2

Accepted Solution

by:
Thaddy earned 100 total points
ID: 1347380
If you use threads, you MUST call coInitialize in the initialization section of EVERY individal thread (and coUnititialize in the finalization sections.
Imho, you should not use os threading, but com threading for a midas solution. Take a look at this site, it contains a midas example of what you want to achieve.
http://www.castle.net/~bly/Programming/Delphi/Threading2/index.html
0

Featured Post

Enroll in May's Course of the Month

May’s Course of the Month is now available! Experts Exchange’s Premium Members and Team Accounts have access to a complimentary course each month as part of their membership—an extra way to increase training and boost professional development.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

751 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question