Solved

Delphi MIDAS and threaded client requests

Posted on 1998-11-19
2
509 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
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 …

749 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