Program freezes when calling a .Net DLL

Questions and answers on designing your Servoy solutions, database modelling and other 'how do I do this' that don't fit in any of the other categories

Program freezes when calling a .Net DLL

Postby jd2p » Fri Mar 01, 2013 1:54 am

Hi,

We use Jacob to call our .Net COM DLL from our Servoy solution. Our windows forms work fine, however, certain functionality causes the application to freeze or malfunction. We have seen these cases:
- When showing a Crystal Report and we choose the export option: it freezes. It doesnt get to show the save file dialog.
- When showing a Crystal Report and we choose the print option: it shows the error "an external component has thrown an exception" and then it prints.
- Apparently, whenever we call an open file or save file dialog, it freezes.

I understand this is an unusual setup, and probably the wrapping of objects to make them interoperable is what causes this. But, has anyone encountered something similar?
jd2p
 
Posts: 95
Joined: Thu Dec 08, 2011 1:08 am

Re: Program freezes when calling a .Net DLL

Postby goldcougar » Mon Mar 04, 2013 12:31 am

How exactly are you calling it? Are you using my COM plugin that uses JACOB to do this? See: https://www.servoyforge.net/projects/servoy-com
There are also some recent improvements from Patrick Talbot to deal with 32/64 bit loading. I've never seen the problems you've mentioned when using the COM plugin.
Scott Butler
iTech Professionals, Inc.
SAN Partner

Servoy Consulting & Development
Servoy University- Free Training Videos
Servoy Guy- Free Plugins, Tips & Resources
ServoyForge- Open Source Servoy Components
User avatar
goldcougar
Servoy Expert
 
Posts: 659
Joined: Sun Jan 08, 2006 7:15 am
Location: Cincinnati, OH

Re: Program freezes when calling a .Net DLL

Postby jd2p » Mon May 06, 2013 10:23 pm

Hello Scott, I just noticed your response, I know its been a while.

Yes, I am using the latest servoy-com plugin (silly of me not to mention that). I've noticed that the problem occurs consistently whenever there is an "Open File Dialog" or "Save File Dialog". For example, I want to open an Excel and want the user to select the file or when there is an export option and let the user select the output location. Aside from those situations, it works well. I don't get any warnings, it just freezes. Any ideas on how I could work up towards a solution?

Thanks for the response. Regards,

JD
jd2p
 
Posts: 95
Joined: Thu Dec 08, 2011 1:08 am

Re: Program freezes when calling a .Net DLL

Postby goldcougar » Tue May 07, 2013 11:28 pm

The COM Plugin has a getLastError() function. Anything in there?

You could also try the Jacob forum: http://sourceforge.net/projects/jacob-p ... rum/375946

Worst case you could bypass the plugin and use JacobGen and try to debug from pure java, but debugging COM stuff isn't easy.
Scott Butler
iTech Professionals, Inc.
SAN Partner

Servoy Consulting & Development
Servoy University- Free Training Videos
Servoy Guy- Free Plugins, Tips & Resources
ServoyForge- Open Source Servoy Components
User avatar
goldcougar
Servoy Expert
 
Posts: 659
Joined: Sun Jan 08, 2006 7:15 am
Location: Cincinnati, OH

Re: Program freezes when calling a .Net DLL

Postby jd2p » Thu May 09, 2013 11:06 pm

Hey Scott,

Thing is, the program freezes and we have to kill it with the Task Manager, so I wouldnt be able to use that function. I'll try the forum. Thanks.
jd2p
 
Posts: 95
Joined: Thu Dec 08, 2011 1:08 am

Re: Program freezes when calling a .Net DLL

Postby jd2p » Wed Jun 12, 2013 6:54 pm

I now know why the program hangs when I try to export or print a report from my .net COM application. This is due to the threading model that apparently the Crystal Report Viewer uses. Now, in order for it to be handled properly I found on a FAQ (http://danadler.com/jacob/jacobfaq.html) that this could be overcome by "upgrading to JACOB 1.7 and use the ComThread class to implement COM threading manually". The ServoyCom plugin uses JACOB 1.6. I tried replacing the 1.6 jacob.jar with the 1.7 one and edit the servoyguy_servoycom.jar.jnlp file so it directs to the new version... interop works, but I still get the original problem, I guess because the "use the ComThread class to implement COM threading manually" should be done withing the plugin.
So, anyone has any ideas? Could I use JACOB directly (I don't have the slightest idea of how this could be done :oops: ) or wait for this to be addressed in the plugin.

Regards,
JD
jd2p
 
Posts: 95
Joined: Thu Dec 08, 2011 1:08 am

Re: Program freezes when calling a .Net DLL

Postby sean » Wed Apr 06, 2016 6:21 pm

A crystal reports integration plugin is now available for Servoy.
Please see this forum post for more detail.
Software Engineer
Servoy USA
sean
 
Posts: 95
Joined: Mon May 21, 2007 6:26 pm
Location: USA


Return to Programming with Servoy

Who is online

Users browsing this forum: No registered users and 5 guests