CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 8 of 8
  1. #1
    Guest

    Concurrent Processes in VB

    I have a question! Is it possible to program a concurrent process within VB which will execute in the back ground
    of a VB form constantly monitoring for updates in a field. This concurrent process does not necessarily
    have to be written in VB itself. Is this possible?

    Cheers



  2. #2
    Join Date
    May 1999
    Location
    Oxford UK
    Posts
    1,459

    Re: Concurrent Processes in VB

    You could just use a Timer control in VB to handle this - simply place a timer on the form whose values you wish to check, then set the interval and write the code in the timer event to check those fields.


    Chris Eastwood

    CodeGuru - the website for developers
    http://codeguru.developer.com/vb

  3. #3
    Guest

    Re: Concurrent Processes in VB

    I need the SQL Server to notify the VB Clients in real time of any changes and therefore timer type polling will not do. The process has to be continous. I believe spawning a continous thread in VB is not the best way. Do you have any suggestions on how to achieve such a goal? (I have heard of two technologies so far DCOM + MTS or Extended Stored Procedures + ActiveX)

    Cheers for you help


  4. #4

    Re: Concurrent Processes in VB

    how do you create a thread in vb? i guess if i'm not wrong that is what you are asking? if you find out a way to run concurrent process please post it here.


  5. #5
    Join Date
    May 1999
    Location
    Oxford UK
    Posts
    1,459

    Re: Concurrent Processes in VB

    The article at :

    http://codeguru.developer.com/vb/articles/1771.shtml

    contains code that shows how to create a thread under visual basic. Be warned though that VB isn't really designed to use the CreateThread api calls and there's a lot of work (and crashing ) to get the routines working properly (although the example manages it, just be careful when hacking out the code).

    You could, alternatively, create an ActiveX EXE that runs out-of-process to handle your background processes.


    Chris Eastwood

    CodeGuru - the website for developers
    http://codeguru.developer.com/vb

  6. #6
    Join Date
    May 1999
    Posts
    3,332

    Re: Concurrent Processes in VB

    are you sure this is the right URL? the article deals with registering components. I didn't see any Thread code.
    Am I blind?


  7. #7
    Join Date
    May 1999
    Location
    Oxford UK
    Posts
    1,459

    Re: Concurrent Processes in VB

    The thread code is deep within the actual source of the downloadable project. The program doesn't use the 'RegSvr32' program, instead it creates a separate process to register the component using the API.



    Chris Eastwood

    CodeGuru - the website for developers
    http://codeguru.developer.com/vb

  8. #8

    Re: Concurrent Processes in VB

    out of process will not work. i need to stop a api function call in the middle of execution, if it takes too long to complete.

    timer does not work. the stupid control waits patiently until the function returns. i dont know what use is this timer control for? if i set the interval to 5sec should not the timer event be fired at 5 sec?

    i am planning to execute this timer in a background thread, that way i can be sure the timer event will be fired regularly.


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

Featured