Results 1 to 2 of 2

Thread: COM threading issue

  1. #1

    Thread Starter
    Fanatic Member venerable bede's Avatar
    Join Date
    Sep 2002
    Location
    The mystic land of Geordies
    Posts
    1,018

    COM threading issue

    Hi All,

    My problem is thus :

    Within my application there is a button which fires off some code which performs an import operation via a call to some unmanaged code.

    The problem is that it can sometimes take an age to process.

    Whats the best way to handle this solution ?
    It would be nice if I had some kind of button allowing the user to cancel the operation if it takes to long but every time I touch threads and UI components I screw up big time.

    Thanks in Advance :-)

    Parksie

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,222

    Re: COM threading issue

    If your unmanaged function is synchronous then cancelling it isn't really an option. If you want to call it in a background thread then, oddly enough, you should start a background thread and call it. Whether or not you screw up when accessing the UI is a completely unrelated issue.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width