Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Thu Sep 19, 2019 3:50 pm
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: Non-Blocking DLL-Call?
PostPosted: Thu Aug 23, 2012 6:28 am 
Offline

Joined: Sun Nov 26, 2006 11:01 am
Posts: 58
Hello all,

DLL-Calls in RealStudio block the UI until the call is finished, even when the call is used in a thread (because of cooperative threads). I want to stop a service (Win32API: ControlService) which takes about 10 seconds for cleanup, so the UI is completely blocked for this time.

Would an asynchronous shell execution work, or a call to an own dll which uses preemptive threads and therefore can yield time back to RS? But that would be a lot of additional work for just a simple task. Maybe someone got an easier solution?

Thanks.


Top
 Profile  
Reply with quote  
 Post subject: Re: Non-Blocking DLL-Call?
PostPosted: Thu Aug 23, 2012 7:08 pm 
Offline

Joined: Wed May 20, 2009 11:02 am
Posts: 423
A simple solution is a helper application: You create a console application that only does the dll call blocking your main application, and execute it from your main application (using folderitem.launch, or shell.execute as you proposed)

You don't need another dll.

HTH,

Pixe

_________________
Using RS2011r4.3 on Windows7.


Top
 Profile  
Reply with quote  
 Post subject: Re: Non-Blocking DLL-Call?
PostPosted: Fri Aug 24, 2012 2:44 am 
Offline

Joined: Sun Nov 26, 2006 11:01 am
Posts: 58
Thanks. I would prefer a dll, because external application trigger firewalls and also I can pass and retrieve parameters more easier with a dll-call.

I'll try it with Shell.execute.


Top
 Profile  
Reply with quote  
 Post subject: Re: Non-Blocking DLL-Call?
PostPosted: Fri Aug 24, 2012 9:21 am 
Offline
Real Software Engineer

Joined: Sat Dec 24, 2005 8:18 pm
Posts: 7858
Location: Canada, Alberta, Near Red Deer
To NOT block you need to turn the DLL into a plugin and have it yield time back to the runtime
Otherwise a helper app or shell that is async will be the only way to get it to not block

_________________
Norman Palardy (Real Software)


Top
 Profile  
Reply with quote  
 Post subject: Re: Non-Blocking DLL-Call?
PostPosted: Fri Aug 24, 2012 9:58 am 
Offline

Joined: Sun Nov 26, 2006 11:01 am
Posts: 58
npalardy wrote:
To NOT block you need to turn the DLL into a plugin and have it yield time back to the runtime
Otherwise a helper app or shell that is async will be the only way to get it to not block


You can't develop a plugin with RS itself can you?
The plugin-examples are only in C/C++.


Top
 Profile  
Reply with quote  
 Post subject: Re: Non-Blocking DLL-Call?
PostPosted: Fri Aug 24, 2012 4:12 pm 
Offline
Real Software Engineer

Joined: Sat Dec 24, 2005 8:18 pm
Posts: 7858
Location: Canada, Alberta, Near Red Deer
Not at this time no

_________________
Norman Palardy (Real Software)


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group