Welcome to LEAD Support Forum Login | Register | Faq  

    LEAD Support Forum
  Resource to find answers and post technical questions about LEAD products.
Search    
   

Re: ePrint COM in threads
Started by Nephilim2612 at 10-03-2007 7:08. Topic has 2 replies.

Print Search « Previous Thread Next Thread »
  10-03-2007, 7:08
Nephilim2612 is not online. Last active: 11/2/2007 3:24:45 PM Nephilim2612

Top 500 Posts
Joined on 06-19-2007
Posts 12
ePrint COM in threads
Reply Quote
Regarding the following thread i posted some weeks ago:

http://support.leadtools.com/SupportPortal/cs/forums/15861/ShowPost.aspx

I've tried to make this sample application becoming a service, but i've found an important problem.

My service send multiple documents (i.e, called "doc1", "doc2", etc...) through a loop. The first is processed ok, but when i try with the second, all is going right until the method "EndDocumentConversion" is called.

The point is that, in order this operation to be performed within a service, it has to be invoked within a new thread.

Do this have any decissive influence regarding the problem i'm chasing against? If yes, how can i solve it?

Thank you very much,

Jesús
   Report 
  10-04-2007, 9:07
Adnan Ismail is not online. Last active: 10/7/2008 3:40:32 PM Adnan Ismail



Top 10 Posts
Joined on 07-31-2006
Posts 1,214
Re: ePrint COM in threads
Reply Quote

Jesús,

Do you mean your program works in multiple-threads, or it does not work in multiple-threads?

In any case, to be able to use our ePrint 5 COM object, the threading model of the thread that creates the object must be Single-threaded apartment.


Adnan Ismail
LEADTOOLS Technical Support

   Report 
  10-05-2007, 6:57
Nephilim2612 is not online. Last active: 11/2/2007 3:24:45 PM Nephilim2612

Top 500 Posts
Joined on 06-19-2007
Posts 12
Re: ePrint COM in threads
Reply Quote
Hi, Adnan,

The service i'm testing creates a single thread within where all the documents to be converted are processed. I have tested both the STA and MTA models.

At this time i've been able to solve the problem, i think definitively. The cause was that i was storing the hDC value returned by the CreateSaveDC method in a global service variable. By keeping the value in a local method variable seems to be the problem is solved. I think, if that helps you, that it could be a problem regarding the context where certain values are kept/recovered.

I think this should be an issue regarding multi-threading with .NET, or maybe regarding .NET multi-threading VS COM, but maybe it could have to be with ePrint COM. I leave here this info in case it has to be with ePrint COM and can help you.

Thank you very much
   Report 
Post
LEAD Support Fo... » Developer » ePrint API » Re: ePrint COM in threads

Powered by Community Server, by Telligent Systems