Jump to content


Check out our Community Blogs

Register and join over 40,000 other developers!


Recent Status Updates

View All Updates

Photo
- - - - -

Not Wait For Running...


  • Please log in to reply
3 replies to this topic

#1 Saeed7007

Saeed7007

    CC Regular

  • Member
  • PipPipPip
  • 43 posts

Posted 25 April 2012 - 05:07 AM

i'm using CreateOleObject('Matlab.Application') to run Matlab and using it...(Matlab takes 10-15 seconds to run. becuase of this long time, i've put progressbar and it takes 20 second to get to 100%)

i put a progressbar. when i use the CreateOleObject, the application hangs for 5-10 seconds.specialy progressbar from 1% jump to 80% after the hanging finished.

i've used thread with CoInitialize(nil); and agian i have problem...

how can i run CreateOleObject('Matlab.Application') and progressbar never hangs?

Thanks.
  • 0

#2 Luthfi

Luthfi

    CC Leader

  • Expert Member
  • PipPipPipPipPipPipPip
  • 1320 posts
  • Programming Language:PHP, Delphi/Object Pascal, Pascal, Transact-SQL
  • Learning:C, Java, PHP

Posted 25 April 2012 - 07:05 AM

You can't. The process is synchronous without providing callback or event. So you have to wait the ole object creation is finished before continue to next code. You can try to move the creation to separate thread where the main thread showing "dummy" progress bar.
  • 0

#3 Saeed7007

Saeed7007

    CC Regular

  • Member
  • PipPipPip
  • 43 posts

Posted 25 April 2012 - 07:24 AM

i don't think it is impossible...
I believe "The Power of Delphi" and I'm sure it is possible.. yeah, surely...
I'll ask my Pro. and will find the answer.
  • 0

#4 Luthfi

Luthfi

    CC Leader

  • Expert Member
  • PipPipPipPipPipPipPip
  • 1320 posts
  • Programming Language:PHP, Delphi/Object Pascal, Pascal, Transact-SQL
  • Learning:C, Java, PHP

Posted 25 April 2012 - 10:26 AM

Nice spirit! I hope you can share your finding here.
  • 0




Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download