Konstantin Mironovich | 15 Feb 2012 20:37
Favicon

CShellFileOpenDialog/CShellFileSaveDialog hang up my App

Hello,

I wonder but I cannot find the reason.
The code is:

CShellFileSaveDialog fd;

if (fd.DoModal(GetParent()) == IDOK)

{

  CStringW s;

  fd.GetFilePath(s);

}

DoModal() hangs my WTL-based program. I believe the latest WTL build is used 
under Vista x64 + Sp2.

Thanks

-km 

------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/wtl/
(Continue reading)

Konstantin Mironovich | 17 Feb 2012 01:49
Favicon

Re: CShellFileOpenDialog/CShellFileSaveDialog hang up my App

probably something wrong with my App mainloop.
fd.DoModal(::GetDesktopWindow()) works fine.

-km

----- Original Message ----- 
From: "Konstantin Mironovich" <const@...>
To: <wtl@...>
Sent: Wednesday, February 15, 2012 11:37 PM
Subject: [wtl] CShellFileOpenDialog/CShellFileSaveDialog hang up my App

> Hello,
>
> I wonder but I cannot find the reason.
> The code is:
>
> CShellFileSaveDialog fd;
>
> if (fd.DoModal(GetParent()) == IDOK)
>
> {
>
>  CStringW s;
>
>  fd.GetFilePath(s);
>
> }
>
> DoModal() hangs my WTL-based program. I believe the latest WTL build is 
> used
(Continue reading)

Nenad Stefanović | 17 Feb 2012 02:00
Picon

Re: CShellFileOpenDialog/CShellFileSaveDialog hang up my App

What is GetParent() returning in your code?

Cheers,
Nenad

2012/2/16 Konstantin Mironovich <const@...>

> probably something wrong with my App mainloop.
> fd.DoModal(::GetDesktopWindow()) works fine.
>
>
> -km
>
> ----- Original Message -----
> From: "Konstantin Mironovich" <const@...>
> To: <wtl@...>
> Sent: Wednesday, February 15, 2012 11:37 PM
> Subject: [wtl] CShellFileOpenDialog/CShellFileSaveDialog hang up my App
>
>
> > Hello,
> >
> > I wonder but I cannot find the reason.
> > The code is:
> >
> > CShellFileSaveDialog fd;
> >
> > if (fd.DoModal(GetParent()) == IDOK)
> >
> > {
(Continue reading)

Konstantin Mironovich | 17 Feb 2012 07:44
Favicon

Re: CShellFileOpenDialog/CShellFileSaveDialog hang up my App

guess the parent is valid.
furthermore CFileDialog works pretty good in this App.
also both work in another WTL-based program.
I suspect these Vista COM-based dialogs are just ill-designed.

-km

  ----- Original Message ----- 
  From: Nenad Stefanovic
  To: wtl@...
  Sent: Friday, February 17, 2012 5:00 AM
  Subject: Re: [wtl] CShellFileOpenDialog/CShellFileSaveDialog hang up my 
App

  What is GetParent() returning in your code?

  Cheers,
  Nenad

  2012/2/16 Konstantin Mironovich <const@...>

  > probably something wrong with my App mainloop.
  > fd.DoModal(::GetDesktopWindow()) works fine.
  >
  >
  > -km
  >
  > ----- Original Message -----
  > From: "Konstantin Mironovich" <const@...>
  > To: <wtl@...>
(Continue reading)

Nenad Stefanović | 17 Feb 2012 09:24
Picon

Re: CShellFileOpenDialog/CShellFileSaveDialog hang up my App

Parent needs to be a top level window, not just valid. Or, it could be
Vista - have you tried it on Win7?

Cheers,
Nenad

On Thu, Feb 16, 2012 at 10:44 PM, Konstantin Mironovich <const@...>wrote:

> **
>
>
> guess the parent is valid.
> furthermore CFileDialog works pretty good in this App.
> also both work in another WTL-based program.
> I suspect these Vista COM-based dialogs are just ill-designed.
>
>
> -km
>
> ----- Original Message -----
> From: Nenad Stefanovic
> To: wtl@...
> Sent: Friday, February 17, 2012 5:00 AM
> Subject: Re: [wtl] CShellFileOpenDialog/CShellFileSaveDialog hang up my
> App
>
> What is GetParent() returning in your code?
>
> Cheers,
> Nenad
(Continue reading)

Konstantin Mironovich | 17 Feb 2012 18:49
Favicon

Re: CShellFileOpenDialog/CShellFileSaveDialog hang up my App

the default parent is ::GetActiveWindow()
for both CFileDialog::DoModal() and CShellFileSaveDialog::DoModal()
and only the first works in my case.
Win7 will be next. not tried yet.

-km

----- Original Message ----- 
From: "Nenad Stefanovic" <nenad2001@...>
To: <wtl@...>
Sent: Friday, February 17, 2012 12:24 PM
Subject: Re: [wtl] CShellFileOpenDialog/CShellFileSaveDialog hang up my App

> Parent needs to be a top level window, not just valid. Or, it could be
> Vista - have you tried it on Win7?
>
> Cheers,
> Nenad
>
>
>
>
> On Thu, Feb 16, 2012 at 10:44 PM, Konstantin Mironovich 
> <const@...>wrote:
>
>> **
>>
>>
>> guess the parent is valid.
>> furthermore CFileDialog works pretty good in this App.
(Continue reading)

Timo Kunze | 17 Feb 2012 21:39
Picon
Picon

Re: CShellFileOpenDialog/CShellFileSaveDialog hang up my App

Hi,

could it be that all that is missing is a call to CoInitialize?

Regards
Timo
-- 
www.TimoSoft-Software.de - Unicode controls for VB6
"Those who sacrifice freedom for safety deserve neither."
"Demokratie ist per Definition unsicher. Ihr Schutz entsteht aus der
Überzeugung, dass die demokratischen Kräfte überwiegen und sich – auf
demokratischem Wege – durchsetzen."

------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/wtl/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/wtl/join
    (Yahoo! ID required)

<*> To change settings via email:
    wtl-digest@... 
    wtl-fullfeatured@...
(Continue reading)

Konstantin Mironovich | 18 Feb 2012 15:14
Favicon

Re: Re: CShellFileOpenDialog/CShellFileSaveDialog hang up my App

Thank for the idea, I don't think it's necessary. Nevertheless I've tried 
both cases.
Anyway this code works with S_OK :
CComPtr<IFileSaveDialog> pfd = fd.GetPtr();

CComQIPtr<IFileDialogCustomize> pfdc = pfd;

(btw, customization is the reason for me to use subj dialogs)

-km

  ----- Original Message ----- 
  From: Timo Kunze
  To: wtl@...
  Sent: Saturday, February 18, 2012 12:39 AM
  Subject: [wtl] Re: CShellFileOpenDialog/CShellFileSaveDialog hang up my 
App

  Hi,

  could it be that all that is missing is a call to CoInitialize?

  Regards
  Timo
  -- 
  www.TimoSoft-Software.de - Unicode controls for VB6
  "Those who sacrifice freedom for safety deserve neither."
  "Demokratie ist per Definition unsicher. Ihr Schutz entsteht aus der
  Überzeugung, dass die demokratischen Kräfte überwiegen und sich – auf
  demokratischem Wege – durchsetzen."
(Continue reading)


Gmane