Home All Groups Group Topic Archive Search About

Alternative to OpenFileDialog?

Author
8 May 2006 6:02 AM
Adam Honek
Given I have problems with using OpenFileDialog as explained in another
thread
here, what other options are there?

All I need is for the user to be able to browse for files and select one or
more. That's it.

Thanks
Adam

Author
8 May 2006 6:37 AM
Cor Ligthert [MVP]
Adam,

Threads are not meant for UI operations, (while it is not impossible would I
like to avoid that just because of design).

Cor

Show quoteHide quote
"Adam Honek" <AdamHo***@Webmaster2001.freeserve.co.uk> schreef in bericht
news:u$dBOUmcGHA.1276@TK2MSFTNGP03.phx.gbl...
> Given I have problems with using OpenFileDialog as explained in another
> thread
> here, what other options are there?
>
> All I need is for the user to be able to browse for files and select one
> or more. That's it.
>
> Thanks
> Adam
>
Author
8 May 2006 6:42 AM
Adam Honek
A form is started in a thread.

Both font and color dialog controls open up and work fine.

openfiledialog just crashes out.

Adam

Show quoteHide quote
"Cor Ligthert [MVP]" <notmyfirstn***@planet.nl> wrote in message
news:%23uoyvmmcGHA.3908@TK2MSFTNGP04.phx.gbl...
> Adam,
>
> Threads are not meant for UI operations, (while it is not impossible would
> I like to avoid that just because of design).
>
> Cor
>
> "Adam Honek" <AdamHo***@Webmaster2001.freeserve.co.uk> schreef in bericht
> news:u$dBOUmcGHA.1276@TK2MSFTNGP03.phx.gbl...
>> Given I have problems with using OpenFileDialog as explained in another
>> thread
>> here, what other options are there?
>>
>> All I need is for the user to be able to browse for files and select one
>> or more. That's it.
>>
>> Thanks
>> Adam
>>
>
>
Author
8 May 2006 8:07 AM
gene kelley
On Mon, 8 May 2006 07:42:32 +0100, "Adam Honek"
<AdamHo***@Webmaster2001.freeserve.co.uk> wrote:

Show quoteHide quote
>A form is started in a thread.
>
>Both font and color dialog controls open up and work fine.
>
>openfiledialog just crashes out.
>
>Adam
>
>"Cor Ligthert [MVP]" <notmyfirstn***@planet.nl> wrote in message
>news:%23uoyvmmcGHA.3908@TK2MSFTNGP04.phx.gbl...
>> Adam,
>>
>> Threads are not meant for UI operations, (while it is not impossible would
>> I like to avoid that just because of design).
>>
>> Cor
>>
>> "Adam Honek" <AdamHo***@Webmaster2001.freeserve.co.uk> schreef in bericht
>> news:u$dBOUmcGHA.1276@TK2MSFTNGP03.phx.gbl...
>>> Given I have problems with using OpenFileDialog as explained in another
>>> thread
>>> here, what other options are there?
>>>
>>> All I need is for the user to be able to browse for files and select one
>>> or more. That's it.
>>>
>>> Thanks
>>> Adam
>>>
>>
>>
>
Just a shot in the dark.

Are you using the FileDialog component or FileDialog Class?

I cannot get the ImageList compnent to work, here, to save my life,
but the ImageList Class works fine and is what I am having to use. The
component seems to work for others, however.

Perhaps, you are experiencing a similar querk.

Gene
Author
8 May 2006 8:19 AM
Adam Honek
The control.

Does the class also support firing up the GUI to select the file?

Adam

Show quoteHide quote
"gene kelley" <o***@by.me> wrote in message
news:lput52d50ad8oip51mj1ubarvt11uh1in4@4ax.com...
> On Mon, 8 May 2006 07:42:32 +0100, "Adam Honek"
> <AdamHo***@Webmaster2001.freeserve.co.uk> wrote:
>
>>A form is started in a thread.
>>
>>Both font and color dialog controls open up and work fine.
>>
>>openfiledialog just crashes out.
>>
>>Adam
>>
>>"Cor Ligthert [MVP]" <notmyfirstn***@planet.nl> wrote in message
>>news:%23uoyvmmcGHA.3908@TK2MSFTNGP04.phx.gbl...
>>> Adam,
>>>
>>> Threads are not meant for UI operations, (while it is not impossible
>>> would
>>> I like to avoid that just because of design).
>>>
>>> Cor
>>>
>>> "Adam Honek" <AdamHo***@Webmaster2001.freeserve.co.uk> schreef in
>>> bericht
>>> news:u$dBOUmcGHA.1276@TK2MSFTNGP03.phx.gbl...
>>>> Given I have problems with using OpenFileDialog as explained in another
>>>> thread
>>>> here, what other options are there?
>>>>
>>>> All I need is for the user to be able to browse for files and select
>>>> one
>>>> or more. That's it.
>>>>
>>>> Thanks
>>>> Adam
>>>>
>>>
>>>
>>
> Just a shot in the dark.
>
> Are you using the FileDialog component or FileDialog Class?
>
> I cannot get the ImageList compnent to work, here, to save my life,
> but the ImageList Class works fine and is what I am having to use. The
> component seems to work for others, however.
>
> Perhaps, you are experiencing a similar querk.
>
> Gene
>
>
Author
8 May 2006 7:35 PM
gene kelley
On Mon, 8 May 2006 09:19:15 +0100, "Adam Honek"
<AdamHo***@Webmaster2001.freeserve.co.uk> wrote:

>The control.
>
>Does the class also support firing up the GUI to select the file?
>
>Adam
>

Yes. 

Gene


Show quoteHide quote
>"gene kelley" <o***@by.me> wrote in message
>news:lput52d50ad8oip51mj1ubarvt11uh1in4@4ax.com...
>> On Mon, 8 May 2006 07:42:32 +0100, "Adam Honek"
>> <AdamHo***@Webmaster2001.freeserve.co.uk> wrote:
>>
>>>A form is started in a thread.
>>>
>>>Both font and color dialog controls open up and work fine.
>>>
>>>openfiledialog just crashes out.
>>>
>>>Adam
>>>
>>>"Cor Ligthert [MVP]" <notmyfirstn***@planet.nl> wrote in message
>>>news:%23uoyvmmcGHA.3908@TK2MSFTNGP04.phx.gbl...
>>>> Adam,
>>>>
>>>> Threads are not meant for UI operations, (while it is not impossible
>>>> would
>>>> I like to avoid that just because of design).
>>>>
>>>> Cor
>>>>
>>>> "Adam Honek" <AdamHo***@Webmaster2001.freeserve.co.uk> schreef in
>>>> bericht
>>>> news:u$dBOUmcGHA.1276@TK2MSFTNGP03.phx.gbl...
>>>>> Given I have problems with using OpenFileDialog as explained in another
>>>>> thread
>>>>> here, what other options are there?
>>>>>
>>>>> All I need is for the user to be able to browse for files and select
>>>>> one
>>>>> or more. That's it.
>>>>>
>>>>> Thanks
>>>>> Adam
>>>>>
>>>>
>>>>
>>>
>> Just a shot in the dark.
>>
>> Are you using the FileDialog component or FileDialog Class?
>>
>> I cannot get the ImageList compnent to work, here, to save my life,
>> but the ImageList Class works fine and is what I am having to use. The
>> component seems to work for others, however.
>>
>> Perhaps, you are experiencing a similar querk.
>>
>> Gene
>>
>>
>
Author
8 May 2006 9:36 AM
Herfried K. Wagner [MVP]
"Adam Honek" <AdamHo***@Webmaster2001.freeserve.co.uk> schrieb:
>A form is started in a thread.

Check the value 'System.Threading.Thread.CurrentThread.ApartmentState'
returns.  If it's 'ApartmentState.MTA' set it to 'ApartmentState.STA'.

> Both font and color dialog controls open up and work fine.
>
> openfiledialog just crashes out.

All of those dialogs are internally based on Win32 API calls, and maybe some
of them only work with STA.

--
M S   Herfried K. Wagner
M V P  <URL:http://dotnet.mvps.org/>
V B   <URL:http://classicvb.org/petition/>
Author
8 May 2006 10:16 AM
Adam Honek
Followed your advice and finally.....it worked.

Why can't MS put this stuff in the help files beats me.

Thanks so much, problem solved.

Adam

Show quoteHide quote
"Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.at> wrote in message
news:e%23MCVLocGHA.3952@TK2MSFTNGP04.phx.gbl...
> "Adam Honek" <AdamHo***@Webmaster2001.freeserve.co.uk> schrieb:
>>A form is started in a thread.
>
> Check the value 'System.Threading.Thread.CurrentThread.ApartmentState'
> returns.  If it's 'ApartmentState.MTA' set it to 'ApartmentState.STA'.
>
>> Both font and color dialog controls open up and work fine.
>>
>> openfiledialog just crashes out.
>
> All of those dialogs are internally based on Win32 API calls, and maybe
> some of them only work with STA.
>
> --
> M S   Herfried K. Wagner
> M V P  <URL:http://dotnet.mvps.org/>
> V B   <URL:http://classicvb.org/petition/>