Click here to Skip to main content
15,907,396 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: Comboboxes in Datagrid view Pin
Richard MacCutchan9-Dec-09 3:49
mveRichard MacCutchan9-Dec-09 3:49 
GeneralRe: Comboboxes in Datagrid view Pin
EvanSaunders9-Dec-09 20:50
EvanSaunders9-Dec-09 20:50 
GeneralRe: Comboboxes in Datagrid view Pin
Richard MacCutchan9-Dec-09 23:22
mveRichard MacCutchan9-Dec-09 23:22 
GeneralRe: Comboboxes in Datagrid view Pin
EvanSaunders9-Dec-09 23:27
EvanSaunders9-Dec-09 23:27 
QuestionProcess.start wait for a callback Pin
coolpjmartin9-Dec-09 0:47
coolpjmartin9-Dec-09 0:47 
AnswerRe: Process.start wait for a callback Pin
nlarson119-Dec-09 3:44
nlarson119-Dec-09 3:44 
QuestionRe: Process.start wait for a callback Pin
richardw489-Dec-09 5:51
richardw489-Dec-09 5:51 
AnswerRe: Process.start wait for a callback Pin
Alan N9-Dec-09 7:25
Alan N9-Dec-09 7:25 
Hi,
You need interprocess synchronization! There are several methods, but as I'm not an expert at this I'll just give one simple and possibly naive example using a named mutex.

Process1:
using System;
using System.Diagnostics;
using System.Threading;
static void Main() {
  String mutexName = Guid.NewGuid().ToString();
  Process p = Process.Start(@"Process2", mutexName);
  Console.WriteLine("Waiting for Process2 to create the mutex {0}", mutexName);
  Mutex m = null;
  do {
    try {
      m = Mutex.OpenExisting(mutexName);
    } catch (WaitHandleCannotBeOpenedException) {
      Thread.Sleep(50);
    }
  } while (m == null);

  // wait for mutex release
  Console.WriteLine("Process1 has opened the mutex, waiting for release");
  if (m.WaitOne(20000)) {
    Console.WriteLine("Mutex was released");
  } else {
    Console.WriteLine("Wait period exceeded");
  }
  Console.WriteLine("Press enter to exit");
  Console.ReadLine();
}

Process1 starts Process2 passing the desired name of the synchronisation object.
Process1 then polls until the Mutex has been created by Process2.
Process1 can now wait for Process2 to release the Mutex.

Process2:
static void Main(String[] args) {
  Console.WriteLine("Process2 created mutex {0}", args[0]);
  Mutex m = new Mutex(true, args[0]);
  Console.WriteLine("Process2 simulating work for 5 seconds ...");
  Thread.Sleep(5000);
  m.ReleaseMutex();
  Console.WriteLine("Process2 released mutex ...");
  Console.WriteLine("Process2 doing something else ...");
  Thread.Sleep(5000);
  Console.WriteLine("Press enter to exit");
  Console.ReadLine();
}


There are several articles here on CodeProject. Try searching for interprocess communication or synchronisation.

Alan.
GeneralRe: Process.start wait for a callback Pin
coolpjmartin18-Dec-09 6:01
coolpjmartin18-Dec-09 6:01 
QuestionImage not uploading Pin
dcdhingra9-Dec-09 0:32
dcdhingra9-Dec-09 0:32 
AnswerRe: Image not uploading Pin
Dave Kreskowiak9-Dec-09 4:39
mveDave Kreskowiak9-Dec-09 4:39 
GeneralRe: Image not uploading Pin
dcdhingra13-Dec-09 7:09
dcdhingra13-Dec-09 7:09 
QuestionDate formate in VB .net. Pin
jeshra2798-Dec-09 21:14
jeshra2798-Dec-09 21:14 
AnswerRe: Date formate in VB .net. Pin
Ashfield8-Dec-09 21:41
Ashfield8-Dec-09 21:41 
GeneralRe: Date formate in VB .net. Pin
jeshra2798-Dec-09 21:48
jeshra2798-Dec-09 21:48 
GeneralRe: Date formate in VB .net. Pin
Richard MacCutchan8-Dec-09 22:38
mveRichard MacCutchan8-Dec-09 22:38 
GeneralRe: Date formate in VB .net. Pin
jeshra2799-Dec-09 0:27
jeshra2799-Dec-09 0:27 
GeneralRe: Date formate in VB .net. Pin
Richard MacCutchan9-Dec-09 0:38
mveRichard MacCutchan9-Dec-09 0:38 
GeneralRe: Date formate in VB .net. Pin
Ashfield9-Dec-09 1:14
Ashfield9-Dec-09 1:14 
GeneralRe: Date formate in VB .net. Pin
David Skelly9-Dec-09 2:03
David Skelly9-Dec-09 2:03 
AnswerRe: Date formate in VB .net. Pin
Luc Pattyn9-Dec-09 3:18
sitebuilderLuc Pattyn9-Dec-09 3:18 
GeneralRe: Date formate in VB .net. Pin
jeshra2799-Dec-09 3:43
jeshra2799-Dec-09 3:43 
GeneralRe: Date formate in VB .net. Pin
Luc Pattyn9-Dec-09 3:52
sitebuilderLuc Pattyn9-Dec-09 3:52 
GeneralRe: Date formate in VB .net. Pin
richardw489-Dec-09 6:00
richardw489-Dec-09 6:00 
QuestionRandom Acces file (FileGet QUESTION) [modified] Pin
PAguilar098-Dec-09 20:52
PAguilar098-Dec-09 20:52 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.