Solved

Delphi MIDAS and threaded client requests

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

895 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

19 Experts available now in Live!

Get 1:1 Help Now