Solved

Delphi MIDAS and threaded client requests

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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
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…
This video discusses moving either the default database or any database to a new volume.
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

705 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now