Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 8712

Re: Using modal windows forms in B1 9.0

$
0
0

Hi Anton,
I just encountered this problem on 1 of my client's PC running windows 7 64 bit.

In my case, the thread started and the main thread did not wait for the dialog thread.

Thus whatever file the user select did not get into my variable.

 

I don't know if this can help you.

Can you try to put a thread.sleep(500) in your code below ?

 

static string ShowDialog()

  { OpenFileDialog ofd = new OpenFileDialog();

  Thread dlgThread = new Thread( showDialog );

  dlgThread.SetApartmentState( ApartmentState.STA );

  dlgThread.Start(ofd);

            System.Threading.Thread.Sleep(500);                //<--------- HERE

  dlgThread.Join();

  return ofd.FileName;

  }

 

 

I know it is does not make any sense, but just try and see if it works for you..

 

Regards

Edy


Viewing all articles
Browse latest Browse all 8712


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>