CDialog

hi

i want to create an open dialog box to select a folder
When i used CFileDialog i could open only a file.

 CFileDialog cfdOpen(TRUE,NULL,NULL,OFN_HIDEREADONLY | 
OFN_OVERWRITEPROMPT,NULL,NULL);

priya
0
priya (41)
7/5/2003 7:05:27 AM
vc.mfc 33608 articles. 0 followers. Follow

9 Replies
711 Views

Similar Articles

[PageSpeed] 0

Hi priya

To select a folder don't use CFileDialog use 
SHBrowseForFolder shell API. 
here is just an example

      BROWSEINFO bi;
      LPITEMIDLIST pidl;

      bi.hwndOwner = m_hWnd;
    bi.pidlRoot = NULL;
      bi.pszDisplayName = dir;
      bi.lpszTitle = dlgTitle;
      bi.ulFlags = BIF_RETURNONLYFSDIRS;
      bi.lpfn = NULL;
      bi.lParam = 0;
      pidl = SHBrowseForFolder(&bi);
     SHGetPathFromIDList(pidl,di);

you should check the return values of these API.

Hope this clears your doubt.
if U need any more help contact me


>-----Original Message-----
>hi
>
>i want to create an open dialog box to select a folder
>When i used CFileDialog i could open only a file.
>
> CFileDialog cfdOpen(TRUE,NULL,NULL,OFN_HIDEREADONLY | 
>OFN_OVERWRITEPROMPT,NULL,NULL);
>
>priya
>.
>
0
7/5/2003 8:31:57 AM
hi
i got the dialog box . when i used BIF_NEWDIALOGSTYLE
an error undeclared identifier occurred.
 
       OleInitialize(NULL);
  
      bi.ulFlags = BIF_RETURNONLYFSDIRS|BIF_NEWDIALOGSTYLE;
      pidl = SHBrowseForFolder(&bi);
      SHGetPathFromIDList(pidl,cWorkSpace); 

Is it possible to create a directory while browsing for a 
folder.
priya








>-----Original Message-----
>hi priya,
>
>you should use SHBrowseForFolder shell API. see MSDN 
documentation for this.
>here is just an example
>
>      BROWSEINFO bi;
>      LPITEMIDLIST pidl;
>
>      bi.hwndOwner = m_hWnd;
>    bi.pidlRoot = NULL;
>      bi.pszDisplayName = dir;
>      bi.lpszTitle = dlgTitle;
>      bi.ulFlags = BIF_RETURNONLYFSDIRS;
>      bi.lpfn = NULL;
>      bi.lParam = 0;
>      pidl = SHBrowseForFolder(&bi);
>     SHGetPathFromIDList(pidl,di);
>
>you should check the return values of these API.
>
>could you able to get the title of the slide now?
>
>hope that helps.
>
>sreeram
>
>
>"priya" <priya@transversalnet.com> wrote in message
>news:062201c342c3$d042f1d0$a301280a@phx.gbl...
>> hi
>>
>> i want to create an open dialog box to select a folder
>> When i used CFileDialog i could open only a file.
>>
>>  CFileDialog cfdOpen(TRUE,NULL,NULL,OFN_HIDEREADONLY |
>> OFN_OVERWRITEPROMPT,NULL,NULL);
>>
>> priya
>
>
>.
>
0
priya (41)
7/5/2003 9:07:48 AM
hi priya

i could not able to find a value named "BIF_NEWDIALOGSTYLE". i could not
able to find where it is declared. that may be it showed the error. as far
as i know with SHBrowseForFolder you can't create a new directory while
browsing for a folder. but you can do it using CFileDialog itself. i will
try it today and hopefully tommorrow morning i will send you the code. :-)

sreeram

"priya" <priya@transversalnet.com> wrote in message
news:017a01c342d4$e7a36150$a001280a@phx.gbl...
> hi
> i got the dialog box . when i used BIF_NEWDIALOGSTYLE
> an error undeclared identifier occurred.
>
>        OleInitialize(NULL);
>
>       bi.ulFlags = BIF_RETURNONLYFSDIRS|BIF_NEWDIALOGSTYLE;
>       pidl = SHBrowseForFolder(&bi);
>       SHGetPathFromIDList(pidl,cWorkSpace);
>
> Is it possible to create a directory while browsing for a
> folder.
> priya
>
>
>
>
>
>
>
>
> >-----Original Message-----
> >hi priya,
> >
> >you should use SHBrowseForFolder shell API. see MSDN
> documentation for this.
> >here is just an example
> >
> >      BROWSEINFO bi;
> >      LPITEMIDLIST pidl;
> >
> >      bi.hwndOwner = m_hWnd;
> >    bi.pidlRoot = NULL;
> >      bi.pszDisplayName = dir;
> >      bi.lpszTitle = dlgTitle;
> >      bi.ulFlags = BIF_RETURNONLYFSDIRS;
> >      bi.lpfn = NULL;
> >      bi.lParam = 0;
> >      pidl = SHBrowseForFolder(&bi);
> >     SHGetPathFromIDList(pidl,di);
> >
> >you should check the return values of these API.
> >
> >could you able to get the title of the slide now?
> >
> >hope that helps.
> >
> >sreeram
> >
> >
> >"priya" <priya@transversalnet.com> wrote in message
> >news:062201c342c3$d042f1d0$a301280a@phx.gbl...
> >> hi
> >>
> >> i want to create an open dialog box to select a folder
> >> When i used CFileDialog i could open only a file.
> >>
> >>  CFileDialog cfdOpen(TRUE,NULL,NULL,OFN_HIDEREADONLY |
> >> OFN_OVERWRITEPROMPT,NULL,NULL);
> >>
> >> priya
> >
> >
> >.
> >


0
sreeramrs (78)
7/6/2003 5:33:04 AM
hi

 how can i create a button to a dialogbox derived from 
CFileDialog.(it cannot be seen in the resource view, right)
Any way, now  i am satisfied with SHBrowseForFolder
But i don't know, how to enable PSWIZB_NEXT only when the 
user clicks ok button of  SHBrowseForFolder dialog box.

i have included the following code in OnSetActive() 
function
CPropertySheet* parent =(CPropertySheet*)GetParent();
parent->SetWizardButtons(PSWIZB_NEXT);

i also tried to hide the Help button. I added the 
following code in the InitDialog of page1class.

CWnd* pWnd= GetDlgItem(IDHELP);

if(pWnd)
{
ASSERT(pWnd);
pWnd->ShowWindow(FALSE);
}

But the Help button doesn't got hide

priya


>-----Original Message-----
>hi priya
>
>i could not able to find BIF_NEWDIALOGSTYLE.
>
>you can do the folder selection using CFileDialog. what 
yuu have to do is to
>derive a class from CFileDialog. there is an example 
application in MSDN.
>Article ID: Q105497. see this article. download the 
source code for this
>article from microsoft site. that program has got no 
option to create a new
>folder. but you can place an edit box +  a button. you 
can allow the user to
>create a new directory when he clicks that button. please 
see this. if you
>feel any difficulties tell me. i will send you a running 
example program.
>
>you enable PSWIZB_NEXT   (next button) only when you 
select that
>folder.don't enable it before.
>
>bye
>sreeram
>
>"priya" <priya@transversalnet.com> wrote in message
>news:04ca01c343ac$734f7950$a501280a@phx.gbl...
>> hi
>>
>>  i got BIF_NEWDIALOGSTYLE from the ulFlags of
>> BROWSEINFO structure.(MSDN).
>>
>> I know that it is possible to create a folder if i use
>> CFileDialog .But in that case, i will not be able to
>> select a folder.Selecting a folder is more important in 
my
>> case.
>>
>> Also i am using CPropertySheet wizard.In my first page i
>> want my next button to be disabled.It should be enabled
>> only when i select a folder using SHBrowseForFolder.How
>> can i do this.
>>
>> priya
>>
>>
>> >-----Original Message-----
>> >hi priya
>> >
>> >i could not able to find a value
>> named "BIF_NEWDIALOGSTYLE". i could not
>> >able to find where it is declared. that may be it 
showed
>> the error. as far
>> >as i know with SHBrowseForFolder you can't create a new
>> directory while
>> >browsing for a folder. but you can do it using
>> CFileDialog itself. i will
>> >try it today and hopefully tommorrow morning i will 
send
>> you the code. :-)
>> >
>> >sreeram
>> >
>> >"priya" <priya@transversalnet.com> wrote in message
>> >news:017a01c342d4$e7a36150$a001280a@phx.gbl...
>> >> hi
>> >> i got the dialog box . when i used BIF_NEWDIALOGSTYLE
>> >> an error undeclared identifier occurred.
>> >>
>> >>        OleInitialize(NULL);
>> >>
>> >>       bi.ulFlags =
>> BIF_RETURNONLYFSDIRS|BIF_NEWDIALOGSTYLE;
>> >>       pidl = SHBrowseForFolder(&bi);
>> >>       SHGetPathFromIDList(pidl,cWorkSpace);
>> >>
>> >> Is it possible to create a directory while browsing 
for
>> a
>> >> folder.
>> >> priya
>> >>
>> >>
>> >>
>> >>
>> >>
>> >>
>> >>
>> >>
>> >> >-----Original Message-----
>> >> >hi priya,
>> >> >
>> >> >you should use SHBrowseForFolder shell API. see MSDN
>> >> documentation for this.
>> >> >here is just an example
>> >> >
>> >> >      BROWSEINFO bi;
>> >> >      LPITEMIDLIST pidl;
>> >> >
>> >> >      bi.hwndOwner = m_hWnd;
>> >> >    bi.pidlRoot = NULL;
>> >> >      bi.pszDisplayName = dir;
>> >> >      bi.lpszTitle = dlgTitle;
>> >> >      bi.ulFlags = BIF_RETURNONLYFSDIRS;
>> >> >      bi.lpfn = NULL;
>> >> >      bi.lParam = 0;
>> >> >      pidl = SHBrowseForFolder(&bi);
>> >> >     SHGetPathFromIDList(pidl,di);
>> >> >
>> >> >you should check the return values of these API.
>> >> >
>> >> >could you able to get the title of the slide now?
>> >> >
>> >> >hope that helps.
>> >> >
>> >> >sreeram
>> >> >
>> >> >
>> >> >"priya" <priya@transversalnet.com> wrote in message
>> >> >news:062201c342c3$d042f1d0$a301280a@phx.gbl...
>> >> >> hi
>> >> >>
>> >> >> i want to create an open dialog box to select a
>> folder
>> >> >> When i used CFileDialog i could open only a file.
>> >> >>
>> >> >>  CFileDialog cfdOpen
(TRUE,NULL,NULL,OFN_HIDEREADONLY
>> |
>> >> >> OFN_OVERWRITEPROMPT,NULL,NULL);
>> >> >>
>> >> >> priya
>> >> >
>> >> >
>> >> >.
>> >> >
>> >
>> >
>> >.
>> >
>
>
>.
>
0
priya (41)
7/7/2003 5:42:20 AM
hi
to hide the HELP button try like this.
CWnd* pWnd= GetDlgItem(IDHELP);

 if(pWnd)
{
 ASSERT(pWnd);
 pWnd->ShowWindow(SW_HIDE);
}

For CFileDialog what you have to do is create a dialog box. and create a
classs derived from CFileDialog.

sreeram

"priya" <priya@transversalnet.com> wrote in message
news:70cd01c3444a$88d64bc0$a401280a@phx.gbl...
> hi
>
>  how can i create a button to a dialogbox derived from
> CFileDialog.(it cannot be seen in the resource view, right)
> Any way, now  i am satisfied with SHBrowseForFolder
> But i don't know, how to enable PSWIZB_NEXT only when the
> user clicks ok button of  SHBrowseForFolder dialog box.
>
> i have included the following code in OnSetActive()
> function
> CPropertySheet* parent =(CPropertySheet*)GetParent();
> parent->SetWizardButtons(PSWIZB_NEXT);
>
> i also tried to hide the Help button. I added the
> following code in the InitDialog of page1class.
>
> CWnd* pWnd= GetDlgItem(IDHELP);
>
> if(pWnd)
> {
> ASSERT(pWnd);
> pWnd->ShowWindow(FALSE);
> }
>
> But the Help button doesn't got hide
>
> priya
>
>
> >-----Original Message-----
> >hi priya
> >
> >i could not able to find BIF_NEWDIALOGSTYLE.
> >
> >you can do the folder selection using CFileDialog. what
> yuu have to do is to
> >derive a class from CFileDialog. there is an example
> application in MSDN.
> >Article ID: Q105497. see this article. download the
> source code for this
> >article from microsoft site. that program has got no
> option to create a new
> >folder. but you can place an edit box +  a button. you
> can allow the user to
> >create a new directory when he clicks that button. please
> see this. if you
> >feel any difficulties tell me. i will send you a running
> example program.
> >
> >you enable PSWIZB_NEXT   (next button) only when you
> select that
> >folder.don't enable it before.
> >
> >bye
> >sreeram
> >
> >"priya" <priya@transversalnet.com> wrote in message
> >news:04ca01c343ac$734f7950$a501280a@phx.gbl...
> >> hi
> >>
> >>  i got BIF_NEWDIALOGSTYLE from the ulFlags of
> >> BROWSEINFO structure.(MSDN).
> >>
> >> I know that it is possible to create a folder if i use
> >> CFileDialog .But in that case, i will not be able to
> >> select a folder.Selecting a folder is more important in
> my
> >> case.
> >>
> >> Also i am using CPropertySheet wizard.In my first page i
> >> want my next button to be disabled.It should be enabled
> >> only when i select a folder using SHBrowseForFolder.How
> >> can i do this.
> >>
> >> priya
> >>
> >>
> >> >-----Original Message-----
> >> >hi priya
> >> >
> >> >i could not able to find a value
> >> named "BIF_NEWDIALOGSTYLE". i could not
> >> >able to find where it is declared. that may be it
> showed
> >> the error. as far
> >> >as i know with SHBrowseForFolder you can't create a new
> >> directory while
> >> >browsing for a folder. but you can do it using
> >> CFileDialog itself. i will
> >> >try it today and hopefully tommorrow morning i will
> send
> >> you the code. :-)
> >> >
> >> >sreeram
> >> >
> >> >"priya" <priya@transversalnet.com> wrote in message
> >> >news:017a01c342d4$e7a36150$a001280a@phx.gbl...
> >> >> hi
> >> >> i got the dialog box . when i used BIF_NEWDIALOGSTYLE
> >> >> an error undeclared identifier occurred.
> >> >>
> >> >>        OleInitialize(NULL);
> >> >>
> >> >>       bi.ulFlags =
> >> BIF_RETURNONLYFSDIRS|BIF_NEWDIALOGSTYLE;
> >> >>       pidl = SHBrowseForFolder(&bi);
> >> >>       SHGetPathFromIDList(pidl,cWorkSpace);
> >> >>
> >> >> Is it possible to create a directory while browsing
> for
> >> a
> >> >> folder.
> >> >> priya
> >> >>
> >> >>
> >> >>
> >> >>
> >> >>
> >> >>
> >> >>
> >> >>
> >> >> >-----Original Message-----
> >> >> >hi priya,
> >> >> >
> >> >> >you should use SHBrowseForFolder shell API. see MSDN
> >> >> documentation for this.
> >> >> >here is just an example
> >> >> >
> >> >> >      BROWSEINFO bi;
> >> >> >      LPITEMIDLIST pidl;
> >> >> >
> >> >> >      bi.hwndOwner = m_hWnd;
> >> >> >    bi.pidlRoot = NULL;
> >> >> >      bi.pszDisplayName = dir;
> >> >> >      bi.lpszTitle = dlgTitle;
> >> >> >      bi.ulFlags = BIF_RETURNONLYFSDIRS;
> >> >> >      bi.lpfn = NULL;
> >> >> >      bi.lParam = 0;
> >> >> >      pidl = SHBrowseForFolder(&bi);
> >> >> >     SHGetPathFromIDList(pidl,di);
> >> >> >
> >> >> >you should check the return values of these API.
> >> >> >
> >> >> >could you able to get the title of the slide now?
> >> >> >
> >> >> >hope that helps.
> >> >> >
> >> >> >sreeram
> >> >> >
> >> >> >
> >> >> >"priya" <priya@transversalnet.com> wrote in message
> >> >> >news:062201c342c3$d042f1d0$a301280a@phx.gbl...
> >> >> >> hi
> >> >> >>
> >> >> >> i want to create an open dialog box to select a
> >> folder
> >> >> >> When i used CFileDialog i could open only a file.
> >> >> >>
> >> >> >>  CFileDialog cfdOpen
> (TRUE,NULL,NULL,OFN_HIDEREADONLY
> >> |
> >> >> >> OFN_OVERWRITEPROMPT,NULL,NULL);
> >> >> >>
> >> >> >> priya
> >> >> >
> >> >> >
> >> >> >.
> >> >> >
> >> >
> >> >
> >> >.
> >> >
> >
> >
> >.
> >


0
sreeramrs (78)
7/7/2003 6:48:48 AM
hello priya

here is the code to enable the NEXT button once you selected a folder.

create a BOOL member variable in your CPropertyPage derived class. say in
CPropertyPage1
BOOL bClicked; // say

initialize it to FALSE in its constructor.
BOOL CMyPropertyPage1::OnSetActive() {
CPropertySheet* parent =(CPropertySheet*)GetParent();
parent->SetWizardButtons(bClicked ? PSWIZB_NEXT:0 );
return CPropertyPage::OnSetActive();
}

once you selected the folder make the BOOL variable as TRUE and call
OnSetActive function like below. else you dont do anything. only cancel
button will be enabled.
// folder selected.
bClicked = TRUE;
OnSetActive();

hope now it is clear to you now. did you try to derive a class from
CFileDialog as MSDN says and tried that example to create a new folder.

sreeram

"priya" <priya@transversalnet.com> wrote in message
news:70cd01c3444a$88d64bc0$a401280a@phx.gbl...
> hi
>
>  how can i create a button to a dialogbox derived from
> CFileDialog.(it cannot be seen in the resource view, right)
> Any way, now  i am satisfied with SHBrowseForFolder
> But i don't know, how to enable PSWIZB_NEXT only when the
> user clicks ok button of  SHBrowseForFolder dialog box.
>
> i have included the following code in OnSetActive()
> function
> CPropertySheet* parent =(CPropertySheet*)GetParent();
> parent->SetWizardButtons(PSWIZB_NEXT);
>
> i also tried to hide the Help button. I added the
> following code in the InitDialog of page1class.
>
> CWnd* pWnd= GetDlgItem(IDHELP);
>
> if(pWnd)
> {
> ASSERT(pWnd);
> pWnd->ShowWindow(FALSE);
> }
>
> But the Help button doesn't got hide
>
> priya
>
>
> >-----Original Message-----
> >hi priya
> >
> >i could not able to find BIF_NEWDIALOGSTYLE.
> >
> >you can do the folder selection using CFileDialog. what
> yuu have to do is to
> >derive a class from CFileDialog. there is an example
> application in MSDN.
> >Article ID: Q105497. see this article. download the
> source code for this
> >article from microsoft site. that program has got no
> option to create a new
> >folder. but you can place an edit box +  a button. you
> can allow the user to
> >create a new directory when he clicks that button. please
> see this. if you
> >feel any difficulties tell me. i will send you a running
> example program.
> >
> >you enable PSWIZB_NEXT   (next button) only when you
> select that
> >folder.don't enable it before.
> >
> >bye
> >sreeram
> >
> >"priya" <priya@transversalnet.com> wrote in message
> >news:04ca01c343ac$734f7950$a501280a@phx.gbl...
> >> hi
> >>
> >>  i got BIF_NEWDIALOGSTYLE from the ulFlags of
> >> BROWSEINFO structure.(MSDN).
> >>
> >> I know that it is possible to create a folder if i use
> >> CFileDialog .But in that case, i will not be able to
> >> select a folder.Selecting a folder is more important in
> my
> >> case.
> >>
> >> Also i am using CPropertySheet wizard.In my first page i
> >> want my next button to be disabled.It should be enabled
> >> only when i select a folder using SHBrowseForFolder.How
> >> can i do this.
> >>
> >> priya
> >>
> >>
> >> >-----Original Message-----
> >> >hi priya
> >> >
> >> >i could not able to find a value
> >> named "BIF_NEWDIALOGSTYLE". i could not
> >> >able to find where it is declared. that may be it
> showed
> >> the error. as far
> >> >as i know with SHBrowseForFolder you can't create a new
> >> directory while
> >> >browsing for a folder. but you can do it using
> >> CFileDialog itself. i will
> >> >try it today and hopefully tommorrow morning i will
> send
> >> you the code. :-)
> >> >
> >> >sreeram
> >> >
> >> >"priya" <priya@transversalnet.com> wrote in message
> >> >news:017a01c342d4$e7a36150$a001280a@phx.gbl...
> >> >> hi
> >> >> i got the dialog box . when i used BIF_NEWDIALOGSTYLE
> >> >> an error undeclared identifier occurred.
> >> >>
> >> >>        OleInitialize(NULL);
> >> >>
> >> >>       bi.ulFlags =
> >> BIF_RETURNONLYFSDIRS|BIF_NEWDIALOGSTYLE;
> >> >>       pidl = SHBrowseForFolder(&bi);
> >> >>       SHGetPathFromIDList(pidl,cWorkSpace);
> >> >>
> >> >> Is it possible to create a directory while browsing
> for
> >> a
> >> >> folder.
> >> >> priya
> >> >>
> >> >>
> >> >>
> >> >>
> >> >>
> >> >>
> >> >>
> >> >>
> >> >> >-----Original Message-----
> >> >> >hi priya,
> >> >> >
> >> >> >you should use SHBrowseForFolder shell API. see MSDN
> >> >> documentation for this.
> >> >> >here is just an example
> >> >> >
> >> >> >      BROWSEINFO bi;
> >> >> >      LPITEMIDLIST pidl;
> >> >> >
> >> >> >      bi.hwndOwner = m_hWnd;
> >> >> >    bi.pidlRoot = NULL;
> >> >> >      bi.pszDisplayName = dir;
> >> >> >      bi.lpszTitle = dlgTitle;
> >> >> >      bi.ulFlags = BIF_RETURNONLYFSDIRS;
> >> >> >      bi.lpfn = NULL;
> >> >> >      bi.lParam = 0;
> >> >> >      pidl = SHBrowseForFolder(&bi);
> >> >> >     SHGetPathFromIDList(pidl,di);
> >> >> >
> >> >> >you should check the return values of these API.
> >> >> >
> >> >> >could you able to get the title of the slide now?
> >> >> >
> >> >> >hope that helps.
> >> >> >
> >> >> >sreeram
> >> >> >
> >> >> >
> >> >> >"priya" <priya@transversalnet.com> wrote in message
> >> >> >news:062201c342c3$d042f1d0$a301280a@phx.gbl...
> >> >> >> hi
> >> >> >>
> >> >> >> i want to create an open dialog box to select a
> >> folder
> >> >> >> When i used CFileDialog i could open only a file.
> >> >> >>
> >> >> >>  CFileDialog cfdOpen
> (TRUE,NULL,NULL,OFN_HIDEREADONLY
> >> |
> >> >> >> OFN_OVERWRITEPROMPT,NULL,NULL);
> >> >> >>
> >> >> >> priya
> >> >> >
> >> >> >
> >> >> >.
> >> >> >
> >> >
> >> >
> >> >.
> >> >
> >
> >
> >.
> >


0
sreeramrs (78)
7/7/2003 7:06:44 AM
hello priya

here is the code to enable the NEXT button once you selected a folder.

create a BOOL member variable in your CPropertyPage derived class. say in
CPropertyPage1
BOOL bClicked; // say

initialize it to FALSE in its constructor.
BOOL CMyPropertyPage1::OnSetActive() {
CPropertySheet* parent =(CPropertySheet*)GetParent();
parent->SetWizardButtons(bClicked ? PSWIZB_NEXT:0 );
return CPropertyPage::OnSetActive();
}

once you selected the folder make the BOOL variable as TRUE and call
OnSetActive function like below. else you dont do anything. only cancel
button will be enabled.
// folder selected.
bClicked = TRUE;
OnSetActive();

hope now it is clear to you now. did you try to derive a class from
CFileDialog as MSDN says and tried that example to create a new folder.

sreeram


"priya" <priya@transversalnet.com> wrote in message
news:70cd01c3444a$88d64bc0$a401280a@phx.gbl...
> hi
>
>  how can i create a button to a dialogbox derived from
> CFileDialog.(it cannot be seen in the resource view, right)
> Any way, now  i am satisfied with SHBrowseForFolder
> But i don't know, how to enable PSWIZB_NEXT only when the
> user clicks ok button of  SHBrowseForFolder dialog box.
>
> i have included the following code in OnSetActive()
> function
> CPropertySheet* parent =(CPropertySheet*)GetParent();
> parent->SetWizardButtons(PSWIZB_NEXT);
>
> i also tried to hide the Help button. I added the
> following code in the InitDialog of page1class.
>
> CWnd* pWnd= GetDlgItem(IDHELP);
>
> if(pWnd)
> {
> ASSERT(pWnd);
> pWnd->ShowWindow(FALSE);
> }
>
> But the Help button doesn't got hide
>
> priya
>
>
> >-----Original Message-----
> >hi priya
> >
> >i could not able to find BIF_NEWDIALOGSTYLE.
> >
> >you can do the folder selection using CFileDialog. what
> yuu have to do is to
> >derive a class from CFileDialog. there is an example
> application in MSDN.
> >Article ID: Q105497. see this article. download the
> source code for this
> >article from microsoft site. that program has got no
> option to create a new
> >folder. but you can place an edit box +  a button. you
> can allow the user to
> >create a new directory when he clicks that button. please
> see this. if you
> >feel any difficulties tell me. i will send you a running
> example program.
> >
> >you enable PSWIZB_NEXT   (next button) only when you
> select that
> >folder.don't enable it before.
> >
> >bye
> >sreeram
> >
> >"priya" <priya@transversalnet.com> wrote in message
> >news:04ca01c343ac$734f7950$a501280a@phx.gbl...
> >> hi
> >>
> >>  i got BIF_NEWDIALOGSTYLE from the ulFlags of
> >> BROWSEINFO structure.(MSDN).
> >>
> >> I know that it is possible to create a folder if i use
> >> CFileDialog .But in that case, i will not be able to
> >> select a folder.Selecting a folder is more important in
> my
> >> case.
> >>
> >> Also i am using CPropertySheet wizard.In my first page i
> >> want my next button to be disabled.It should be enabled
> >> only when i select a folder using SHBrowseForFolder.How
> >> can i do this.
> >>
> >> priya
> >>
> >>
> >> >-----Original Message-----
> >> >hi priya
> >> >
> >> >i could not able to find a value
> >> named "BIF_NEWDIALOGSTYLE". i could not
> >> >able to find where it is declared. that may be it
> showed
> >> the error. as far
> >> >as i know with SHBrowseForFolder you can't create a new
> >> directory while
> >> >browsing for a folder. but you can do it using
> >> CFileDialog itself. i will
> >> >try it today and hopefully tommorrow morning i will
> send
> >> you the code. :-)
> >> >
> >> >sreeram
> >> >
> >> >"priya" <priya@transversalnet.com> wrote in message
> >> >news:017a01c342d4$e7a36150$a001280a@phx.gbl...
> >> >> hi
> >> >> i got the dialog box . when i used BIF_NEWDIALOGSTYLE
> >> >> an error undeclared identifier occurred.
> >> >>
> >> >>        OleInitialize(NULL);
> >> >>
> >> >>       bi.ulFlags =
> >> BIF_RETURNONLYFSDIRS|BIF_NEWDIALOGSTYLE;
> >> >>       pidl = SHBrowseForFolder(&bi);
> >> >>       SHGetPathFromIDList(pidl,cWorkSpace);
> >> >>
> >> >> Is it possible to create a directory while browsing
> for
> >> a
> >> >> folder.
> >> >> priya
> >> >>
> >> >>
> >> >>
> >> >>
> >> >>
> >> >>
> >> >>
> >> >>
> >> >> >-----Original Message-----
> >> >> >hi priya,
> >> >> >
> >> >> >you should use SHBrowseForFolder shell API. see MSDN
> >> >> documentation for this.
> >> >> >here is just an example
> >> >> >
> >> >> >      BROWSEINFO bi;
> >> >> >      LPITEMIDLIST pidl;
> >> >> >
> >> >> >      bi.hwndOwner = m_hWnd;
> >> >> >    bi.pidlRoot = NULL;
> >> >> >      bi.pszDisplayName = dir;
> >> >> >      bi.lpszTitle = dlgTitle;
> >> >> >      bi.ulFlags = BIF_RETURNONLYFSDIRS;
> >> >> >      bi.lpfn = NULL;
> >> >> >      bi.lParam = 0;
> >> >> >      pidl = SHBrowseForFolder(&bi);
> >> >> >     SHGetPathFromIDList(pidl,di);
> >> >> >
> >> >> >you should check the return values of these API.
> >> >> >
> >> >> >could you able to get the title of the slide now?
> >> >> >
> >> >> >hope that helps.
> >> >> >
> >> >> >sreeram
> >> >> >
> >> >> >
> >> >> >"priya" <priya@transversalnet.com> wrote in message
> >> >> >news:062201c342c3$d042f1d0$a301280a@phx.gbl...
> >> >> >> hi
> >> >> >>
> >> >> >> i want to create an open dialog box to select a
> >> folder
> >> >> >> When i used CFileDialog i could open only a file.
> >> >> >>
> >> >> >>  CFileDialog cfdOpen
> (TRUE,NULL,NULL,OFN_HIDEREADONLY
> >> |
> >> >> >> OFN_OVERWRITEPROMPT,NULL,NULL);
> >> >> >>
> >> >> >> priya
> >> >> >
> >> >> >
> >> >> >.
> >> >> >
> >> >
> >> >
> >> >.
> >> >
> >
> >
> >.
> >


0
sreeramrs (78)
7/7/2003 7:16:37 AM
hello priya

you should give that code in OnInitDialog function of CMyPropertySheet (i.e;
the class you derived from CPropertySheet). it should work. here is the code
once again. and ShowWindow parameter must be SW_HIDE. dont give in page1
classes oninitdialog. now only i read your old post correctly. i assume you
gave that in oninitdialog of page1 class. try like this. it will work. :-)

try this code in OnInitDialog function of CMyPropertySheet.

CWnd* pWnd= GetDlgItem(IDHELP);
 if(pWnd)
{
 ASSERT(pWnd);
 pWnd->ShowWindow(SW_HIDE);
}

sreeram

"Sreeram" <sreeramrs@hotmail.com> wrote in message
news:eHYnvPFRDHA.2344@TK2MSFTNGP12.phx.gbl...
> hi
> to hide the HELP button try like this.
> CWnd* pWnd= GetDlgItem(IDHELP);
>
>  if(pWnd)
> {
>  ASSERT(pWnd);
>  pWnd->ShowWindow(SW_HIDE);
> }
>
> For CFileDialog what you have to do is create a dialog box. and create a
> classs derived from CFileDialog.
>
> sreeram
>
> "priya" <priya@transversalnet.com> wrote in message
> news:70cd01c3444a$88d64bc0$a401280a@phx.gbl...
> > hi
> >
> >  how can i create a button to a dialogbox derived from
> > CFileDialog.(it cannot be seen in the resource view, right)
> > Any way, now  i am satisfied with SHBrowseForFolder
> > But i don't know, how to enable PSWIZB_NEXT only when the
> > user clicks ok button of  SHBrowseForFolder dialog box.
> >
> > i have included the following code in OnSetActive()
> > function
> > CPropertySheet* parent =(CPropertySheet*)GetParent();
> > parent->SetWizardButtons(PSWIZB_NEXT);
> >
> > i also tried to hide the Help button. I added the
> > following code in the InitDialog of page1class.
> >
> > CWnd* pWnd= GetDlgItem(IDHELP);
> >
> > if(pWnd)
> > {
> > ASSERT(pWnd);
> > pWnd->ShowWindow(FALSE);
> > }
> >
> > But the Help button doesn't got hide
> >
> > priya
> >
> >
> > >-----Original Message-----
> > >hi priya
> > >
> > >i could not able to find BIF_NEWDIALOGSTYLE.
> > >
> > >you can do the folder selection using CFileDialog. what
> > yuu have to do is to
> > >derive a class from CFileDialog. there is an example
> > application in MSDN.
> > >Article ID: Q105497. see this article. download the
> > source code for this
> > >article from microsoft site. that program has got no
> > option to create a new
> > >folder. but you can place an edit box +  a button. you
> > can allow the user to
> > >create a new directory when he clicks that button. please
> > see this. if you
> > >feel any difficulties tell me. i will send you a running
> > example program.
> > >
> > >you enable PSWIZB_NEXT   (next button) only when you
> > select that
> > >folder.don't enable it before.
> > >
> > >bye
> > >sreeram
> > >
> > >"priya" <priya@transversalnet.com> wrote in message
> > >news:04ca01c343ac$734f7950$a501280a@phx.gbl...
> > >> hi
> > >>
> > >>  i got BIF_NEWDIALOGSTYLE from the ulFlags of
> > >> BROWSEINFO structure.(MSDN).
> > >>
> > >> I know that it is possible to create a folder if i use
> > >> CFileDialog .But in that case, i will not be able to
> > >> select a folder.Selecting a folder is more important in
> > my
> > >> case.
> > >>
> > >> Also i am using CPropertySheet wizard.In my first page i
> > >> want my next button to be disabled.It should be enabled
> > >> only when i select a folder using SHBrowseForFolder.How
> > >> can i do this.
> > >>
> > >> priya
> > >>
> > >>
> > >> >-----Original Message-----
> > >> >hi priya
> > >> >
> > >> >i could not able to find a value
> > >> named "BIF_NEWDIALOGSTYLE". i could not
> > >> >able to find where it is declared. that may be it
> > showed
> > >> the error. as far
> > >> >as i know with SHBrowseForFolder you can't create a new
> > >> directory while
> > >> >browsing for a folder. but you can do it using
> > >> CFileDialog itself. i will
> > >> >try it today and hopefully tommorrow morning i will
> > send
> > >> you the code. :-)
> > >> >
> > >> >sreeram
> > >> >
> > >> >"priya" <priya@transversalnet.com> wrote in message
> > >> >news:017a01c342d4$e7a36150$a001280a@phx.gbl...
> > >> >> hi
> > >> >> i got the dialog box . when i used BIF_NEWDIALOGSTYLE
> > >> >> an error undeclared identifier occurred.
> > >> >>
> > >> >>        OleInitialize(NULL);
> > >> >>
> > >> >>       bi.ulFlags =
> > >> BIF_RETURNONLYFSDIRS|BIF_NEWDIALOGSTYLE;
> > >> >>       pidl = SHBrowseForFolder(&bi);
> > >> >>       SHGetPathFromIDList(pidl,cWorkSpace);
> > >> >>
> > >> >> Is it possible to create a directory while browsing
> > for
> > >> a
> > >> >> folder.
> > >> >> priya
> > >> >>
> > >> >>
> > >> >>
> > >> >>
> > >> >>
> > >> >>
> > >> >>
> > >> >>
> > >> >> >-----Original Message-----
> > >> >> >hi priya,
> > >> >> >
> > >> >> >you should use SHBrowseForFolder shell API. see MSDN
> > >> >> documentation for this.
> > >> >> >here is just an example
> > >> >> >
> > >> >> >      BROWSEINFO bi;
> > >> >> >      LPITEMIDLIST pidl;
> > >> >> >
> > >> >> >      bi.hwndOwner = m_hWnd;
> > >> >> >    bi.pidlRoot = NULL;
> > >> >> >      bi.pszDisplayName = dir;
> > >> >> >      bi.lpszTitle = dlgTitle;
> > >> >> >      bi.ulFlags = BIF_RETURNONLYFSDIRS;
> > >> >> >      bi.lpfn = NULL;
> > >> >> >      bi.lParam = 0;
> > >> >> >      pidl = SHBrowseForFolder(&bi);
> > >> >> >     SHGetPathFromIDList(pidl,di);
> > >> >> >
> > >> >> >you should check the return values of these API.
> > >> >> >
> > >> >> >could you able to get the title of the slide now?
> > >> >> >
> > >> >> >hope that helps.
> > >> >> >
> > >> >> >sreeram
> > >> >> >
> > >> >> >
> > >> >> >"priya" <priya@transversalnet.com> wrote in message
> > >> >> >news:062201c342c3$d042f1d0$a301280a@phx.gbl...
> > >> >> >> hi
> > >> >> >>
> > >> >> >> i want to create an open dialog box to select a
> > >> folder
> > >> >> >> When i used CFileDialog i could open only a file.
> > >> >> >>
> > >> >> >>  CFileDialog cfdOpen
> > (TRUE,NULL,NULL,OFN_HIDEREADONLY
> > >> |
> > >> >> >> OFN_OVERWRITEPROMPT,NULL,NULL);
> > >> >> >>
> > >> >> >> priya
> > >> >> >
> > >> >> >
> > >> >> >.
> > >> >> >
> > >> >
> > >> >
> > >> >.
> > >> >
> > >
> > >
> > >.
> > >
>
>


0
sreeramrs (78)
7/7/2003 7:40:18 AM
hello priya

you should give that code in OnInitDialog function of CMyPropertySheet (i.e;
the class you derived from CPropertySheet). it should work. here is the code
once again. and ShowWindow parameter must be SW_HIDE. dont give in page1
classes oninitdialog. now only i read your old post correctly. i assume you
gave that in oninitdialog of page1 class. try like this. it will work. :-)

try this code in OnInitDialog function of CMyPropertySheet.

CWnd* pWnd= GetDlgItem(IDHELP);
 if(pWnd)
{
 ASSERT(pWnd);
 pWnd->ShowWindow(SW_HIDE);
}

sreeram


"priya" <priya@transversalnet.com> wrote in message
news:024301c34459$ee8ecd20$a001280a@phx.gbl...
>
> hi
>
> the help button is not hiding.
>
> priya
>
>
> >-----Original Message-----
> >hi
> >to hide the HELP button try like this.
> >CWnd* pWnd= GetDlgItem(IDHELP);
> >
> > if(pWnd)
> >{
> > ASSERT(pWnd);
> > pWnd->ShowWindow(SW_HIDE);
> >}
> >
> >For CFileDialog what you have to do is create a dialog
> box. and create a
> >classs derived from CFileDialog.
> >
> >sreeram
> >
> >"priya" <priya@transversalnet.com> wrote in message
> >news:70cd01c3444a$88d64bc0$a401280a@phx.gbl...
> >> hi
> >>
> >>  how can i create a button to a dialogbox derived from
> >> CFileDialog.(it cannot be seen in the resource view,
> right)
> >> Any way, now  i am satisfied with SHBrowseForFolder
> >> But i don't know, how to enable PSWIZB_NEXT only when
> the
> >> user clicks ok button of  SHBrowseForFolder dialog box.
> >>
> >> i have included the following code in OnSetActive()
> >> function
> >> CPropertySheet* parent =(CPropertySheet*)GetParent();
> >> parent->SetWizardButtons(PSWIZB_NEXT);
> >>
> >> i also tried to hide the Help button. I added the
> >> following code in the InitDialog of page1class.
> >>
> >> CWnd* pWnd= GetDlgItem(IDHELP);
> >>
> >> if(pWnd)
> >> {
> >> ASSERT(pWnd);
> >> pWnd->ShowWindow(FALSE);
> >> }
> >>
> >> But the Help button doesn't got hide
> >>
> >> priya
> >>
> >>
> >> >-----Original Message-----
> >> >hi priya
> >> >
> >> >i could not able to find BIF_NEWDIALOGSTYLE.
> >> >
> >> >you can do the folder selection using CFileDialog. what
> >> yuu have to do is to
> >> >derive a class from CFileDialog. there is an example
> >> application in MSDN.
> >> >Article ID: Q105497. see this article. download the
> >> source code for this
> >> >article from microsoft site. that program has got no
> >> option to create a new
> >> >folder. but you can place an edit box +  a button. you
> >> can allow the user to
> >> >create a new directory when he clicks that button.
> please
> >> see this. if you
> >> >feel any difficulties tell me. i will send you a
> running
> >> example program.
> >> >
> >> >you enable PSWIZB_NEXT   (next button) only when you
> >> select that
> >> >folder.don't enable it before.
> >> >
> >> >bye
> >> >sreeram
> >> >
> >> >"priya" <priya@transversalnet.com> wrote in message
> >> >news:04ca01c343ac$734f7950$a501280a@phx.gbl...
> >> >> hi
> >> >>
> >> >>  i got BIF_NEWDIALOGSTYLE from the ulFlags of
> >> >> BROWSEINFO structure.(MSDN).
> >> >>
> >> >> I know that it is possible to create a folder if i
> use
> >> >> CFileDialog .But in that case, i will not be able to
> >> >> select a folder.Selecting a folder is more important
> in
> >> my
> >> >> case.
> >> >>
> >> >> Also i am using CPropertySheet wizard.In my first
> page i
> >> >> want my next button to be disabled.It should be
> enabled
> >> >> only when i select a folder using
> SHBrowseForFolder.How
> >> >> can i do this.
> >> >>
> >> >> priya
> >> >>
> >> >>
> >> >> >-----Original Message-----
> >> >> >hi priya
> >> >> >
> >> >> >i could not able to find a value
> >> >> named "BIF_NEWDIALOGSTYLE". i could not
> >> >> >able to find where it is declared. that may be it
> >> showed
> >> >> the error. as far
> >> >> >as i know with SHBrowseForFolder you can't create a
> new
> >> >> directory while
> >> >> >browsing for a folder. but you can do it using
> >> >> CFileDialog itself. i will
> >> >> >try it today and hopefully tommorrow morning i will
> >> send
> >> >> you the code. :-)
> >> >> >
> >> >> >sreeram
> >> >> >
> >> >> >"priya" <priya@transversalnet.com> wrote in message
> >> >> >news:017a01c342d4$e7a36150$a001280a@phx.gbl...
> >> >> >> hi
> >> >> >> i got the dialog box . when i used
> BIF_NEWDIALOGSTYLE
> >> >> >> an error undeclared identifier occurred.
> >> >> >>
> >> >> >>        OleInitialize(NULL);
> >> >> >>
> >> >> >>       bi.ulFlags =
> >> >> BIF_RETURNONLYFSDIRS|BIF_NEWDIALOGSTYLE;
> >> >> >>       pidl = SHBrowseForFolder(&bi);
> >> >> >>       SHGetPathFromIDList(pidl,cWorkSpace);
> >> >> >>
> >> >> >> Is it possible to create a directory while
> browsing
> >> for
> >> >> a
> >> >> >> folder.
> >> >> >> priya
> >> >> >>
> >> >> >>
> >> >> >>
> >> >> >>
> >> >> >>
> >> >> >>
> >> >> >>
> >> >> >>
> >> >> >> >-----Original Message-----
> >> >> >> >hi priya,
> >> >> >> >
> >> >> >> >you should use SHBrowseForFolder shell API. see
> MSDN
> >> >> >> documentation for this.
> >> >> >> >here is just an example
> >> >> >> >
> >> >> >> >      BROWSEINFO bi;
> >> >> >> >      LPITEMIDLIST pidl;
> >> >> >> >
> >> >> >> >      bi.hwndOwner = m_hWnd;
> >> >> >> >    bi.pidlRoot = NULL;
> >> >> >> >      bi.pszDisplayName = dir;
> >> >> >> >      bi.lpszTitle = dlgTitle;
> >> >> >> >      bi.ulFlags = BIF_RETURNONLYFSDIRS;
> >> >> >> >      bi.lpfn = NULL;
> >> >> >> >      bi.lParam = 0;
> >> >> >> >      pidl = SHBrowseForFolder(&bi);
> >> >> >> >     SHGetPathFromIDList(pidl,di);
> >> >> >> >
> >> >> >> >you should check the return values of these API.
> >> >> >> >
> >> >> >> >could you able to get the title of the slide now?
> >> >> >> >
> >> >> >> >hope that helps.
> >> >> >> >
> >> >> >> >sreeram
> >> >> >> >
> >> >> >> >
> >> >> >> >"priya" <priya@transversalnet.com> wrote in
> message
> >> >> >> >news:062201c342c3$d042f1d0$a301280a@phx.gbl...
> >> >> >> >> hi
> >> >> >> >>
> >> >> >> >> i want to create an open dialog box to select a
> >> >> folder
> >> >> >> >> When i used CFileDialog i could open only a
> file.
> >> >> >> >>
> >> >> >> >>  CFileDialog cfdOpen
> >> (TRUE,NULL,NULL,OFN_HIDEREADONLY
> >> >> |
> >> >> >> >> OFN_OVERWRITEPROMPT,NULL,NULL);
> >> >> >> >>
> >> >> >> >> priya
> >> >> >> >
> >> >> >> >
> >> >> >> >.
> >> >> >> >
> >> >> >
> >> >> >
> >> >> >.
> >> >> >
> >> >
> >> >
> >> >.
> >> >
> >
> >
> >.
> >


0
sreeramrs (78)
7/7/2003 7:44:20 AM
Reply:

Similar Artilces:

Creating a CDialog derived class for a Dialog??
I am trying to convert a project from Win32 to MFC. I created a new dialog resource, but when I try to do the right-click add class thing from the dialog editor, it doesn't do anything. I am using VS.NET 2003 Pro. In the dialog that pops up to create the new class, I change it to derive from CDialog, it already has the ID for my dialogbox resource selected, and I enter a new class name, and it generates the .h and .cpp names. I click Finish and NOTHING happens. I try it again from the main menu, but this time it pops an error box saying "Object Required". I am stumpe...

Changing an MFC CDialog to a control inside another CDialog
Hi everyone, In my MFC application i have a CDialog window which is shown (modal) when clicking on a specific button. After some changes in my application, I decided that I need the controls on that secondary CDialog to be shown always inside the main window. Is there a way to change the secondary CDialog derived window to a control (like CStatic, etc) inside my main window, and not a child window? Maybe changing the devired class (CDialog to CStatic)? or changing some properties in the CDialog and calling its Create method with a specific parameters? Thanks. Menny wrote: > Hi everyone,...

CDialog
hi i want to create an open dialog box to select a folder When i used CFileDialog i could open only a file. CFileDialog cfdOpen(TRUE,NULL,NULL,OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,NULL,NULL); priya Hi priya To select a folder don't use CFileDialog use SHBrowseForFolder shell API. here is just an example BROWSEINFO bi; LPITEMIDLIST pidl; bi.hwndOwner = m_hWnd; bi.pidlRoot = NULL; bi.pszDisplayName = dir; bi.lpszTitle = dlgTitle; bi.ulFlags = BIF_RETURNONLYFSDIRS; bi.lpfn = NULL; bi.lParam = 0; pidl = SHBrowseForFolder(&a...

How to DoModal a CDialog initially invisible
Hi all, Under specific circunstances, I need to start my dialog-based app invisible. Unfortunately, as expected, when I call DoModal, the window is always visible, whatever I do (uncheck the visible box on dialog properties in the resources, ModifyStyle in OnInitDialog, ...) Is there a clean way to do that ? If not, what could be the cleanest dirty way ? ;) Thanks. -- Dansk Just don't call DoModal(). Place the code that you need to execute into a separate function in the same dialog class and call that function. class MyDialog : public CDialog { public: MyDialog() : CDia...

CView VS CDialog
Hello, Can i create some CView on CDialog Object ?? How can i do it ?? thanks. "Ahryman40k" <gbaudin2@wanadoo.fr> wrote in message news:bmefmd$3sv$1@news-reader5.wanadoo.fr... > Hello, > > Can i create some CView on CDialog Object ?? > > How can i do it ?? > > thanks. I'm assuming you mean creating a view as a control on a dialog. It can be done with MFC 6.0, but Microsoft almost certainly doesn't support it and you may find it can't be done in a later version of MFC. Your view needs to override OnMouseActivate so that it doesn'...

Independant Modeless CDialog
Hi, I am having some serious difficulty with a problem of multiple windows in the same application. I use a CDialog as my main window, which is created in the main app call with DoModal, from it however, I wish to create several dialogs that are modeless, each has a taskbar entry (somewhat like MSN messenger) - However, whenever I click on any of these windows the entire job lot pops up, including my origional window. I know in VB that everything was pretty independant, you could switch between windows at your chosing, and only toolbar windows would pop up, thats kind of what I am aft...

Trouble with CDialog DoModal()
I created a new dialog with two buttons and a richedit area. I used the wizard to create a new class and the code. Now, I got: ///////////////////////////////////////////////////////////////////////////// // CStatDialog dialog CStatDialog::CStatDialog(CWnd* pParent /*=NULL*/) : CDialog(CStatDialog::IDD, pParent) { //{{AFX_DATA_INIT(CStatDialog) m_StatisticText = _T(""); //}}AFX_DATA_INIT } void CStatDialog::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(CStatDialog) DDX_Text(pDX, IDC_RICHEDIT1, m_StatisticText); //}}AFX_DATA_MAP } ...

Embed a CFrameWnd into a CDialog
I would like to embed a CFrameWnd into a CDialog. That is, when the CDialog is moved or minimized, the CFrameWnd will also be moved and minimized. I can use the OnMove and OnMinimize of CDialog, but is there any better way of doing so? Thanks. you can just create a Child Dialog inside another dialog. remember to set style of child dialog to Child(default is popup). And you may also want to set its border to none. "Leesei" <someone@microsoft.com> wrote in message news:uamo$RwjEHA.1800@TK2MSFTNGP15.phx.gbl... > I would like to embed a CFrameWnd into a CDialog. > That i...

Problems with CDialog
Hello! I have an application that uses 2 monitors. In one monitor i show some videos and in the other monitor i show the user interface. When I try to open the dialog this cannot be seen and i have to press alt+tab keys so the windows appears. If i create de dialog in this way: MyDialog md; md.Create(IID_MYDIALOG,AfxGetMainWnd()); md.Show(1); The dialog work prefectly and it can be shown without any problem, but if i try to show it as a modal dialog i hava an assert exception. md.Create(IID_MYDIALOG,AfxGetMainWnd()); md.DoModal(); Is there any way to resolve it? Thank you very much...

CDialog cannot be seen
Hi! I have problems opening a modal dialog, when i open it it cannot be seen until i press Alt+Tab, then i can see it in the windows list and the it is shown directly Why this happend? how can i resolve it? This is the code is use to open the dialog: AgregarPosicion ap; char nombre[30]; if(ap.DoModal()==IDOK) { _tcscpy(nombre,ap.nombre); ptz->SetPreset(nombre); presetPosition.AddString(ap.nombre); And this is the code of the dialog: #include "stdafx.h" #include "4player.h" #include "AgregarPosicion.h" // Cuadro de diálogo de Agrega...

A problem with using DataGridView (.NET Windows Forms) in CDialog
I have a very simple CDialog-based application (VC++ 8.0/2005), where a DataGridView control is included through the usage of CWinFormsControl class. I experience the following problem with this application. If I switch to a different application (Alt+Tab, for example) while a grid cell is remaining in editing mode and then go back to my application, the application hangs (stops responding). The problem can be reproduced using CWinFormsControl and CWinFormsView classes, but it is NOT reproducible when using CFrameWnd and CWinFormsView classes or when using DataGrid control instead of t...

CDialog, PreCreateWindow
Hi, I overloaded PreCreateWindow in a CDialog dericed class, but it never gets called. Howcome? Unfortunately, and it's a long story, PreCreateWindow and OnCreate don't get called for dialogs. You can do most of what you want in OnInitDialog() . For example, if you want to resize the dialog you can use MoveWindow() from that point. You can also change styles with ModifyStyle(). OnInitDialog gets called after the window is created, but before it is displayed so it's a great place to initialize controls and set up dialog parameters. Tom "Hanna-Barbera" <hb...

CMFCOutlookBar with CDialog
Hi All! I developp a new MFC application and i try to use the new MFC feature pack... Now i've got problems with the CMFCOutlookBar. I want to add tabs into the CMFCOutlookBar control but this tabs come from CDialog I make in the ressource editor. Here is the piece of code: m_studyDlg.Create(IDD_DLG_STUDY, &m_wndOutlookBar); m_imgPropDlg.Create(IDD_DLG_IMG_PROPERTY, &m_wndOutlookBar); CMFCOutlookBarTabCtrl* pOutlookBar = (CMFCOutlookBarTabCtrl*)m_wndOutlookBar.GetUnderlyingWindow(); str.LoadString(IDS_STUDY); pOutlookBar->AddTab(&m_studyDlg, str, -1, FALSE); str.Loa...

QueryCancelAutoPlay in CDialog
Hello, I am trying to disable Autorun while one of the dialog of my app is shown. I have registered the window message QueryCancelAutoPlay and tried to catch it in several different places (ON_REGISTERED_MESSAGE, DefWindowProc, WindowProc) but I never get such message when I insert a CD. Anyone has ever succeeded in doing this? Regards, Nicolas ...

CMiniFrameWnd and CDialog ???
I am trying to create a dialog based MFC app. (straitforward from the wizard). But now, I want the dialog to have a mini title bar as a CMiniFrameWnd. How can I do it ? Thanks for helping. Fran´┐Żois. Would this work for you? ModifyStyleEx(0, WS_EX_TOOLWINDOW, SWP_FRAMECHANGED) ; "Fran´┐Żois" <nospam@corebridge.com> wrote in message news:OWLvZxgrFHA.460@TK2MSFTNGP15.phx.gbl... >I am trying to create a dialog based MFC app. (straitforward from the >wizard). > > But now, I want the dialog to have a mini title bar as a CMiniFrameWnd. > > How can I do it...

Passing from a CDialog logic to a CView one
Hi, I am developping with MFC under Pocket PC and for some technical reasons I would like to convert an SDI application using a view and some dialogs into one using only views. Let's consider the following scenario : I have my SDI application that display a welcome view(CFormView). Inside this welcome view I have a button to accept or not Terms and conditions. If user accept conditions I would like to switch to the main view, if not, I would like to display a goodbye view. The problem is here : void CWelcomeView::OnYesCommand() { if ( ... == TRUE){ CViewMgr::GetInstance()->S...

CDialog/CPropertyPage inside CDialog
I have a CDialog that I have created as a modeless dialog and embedded successfully in another CDialog. Mouse messages, however do not get sent to the child dialog. I have tried changing the child dialog to be derived from a CPropertyPage instead of a CDialog to no avail. I've set the extended style of the parent dialog to include WS_EX_CONTROLPARENT). I create the child dialog as shown below: m_cSearchPage.Create(IDD_SEARCHPANE, this); m_cSearchPage.ModifyStyle(0, WS_CHILD); m_cSearchPage.SetWindowPos(NULL, 3, 70, 225, 127, SWP_NOZORDER); m_cSearchPage.ShowWindow(SW_SHOW); m_cSearchPag...

Which property of CDialog ?
I have mfc dialog application. In main dialog I have button which on click creates new thread. That thread creates other dialog. Problem is, that after child dialog is in front , main dialog is not accessible, but I need to create several child dialogs not only one. Which property must be set on child dialog to access parent dialog ? Or any other tips ? Thanks ! Peter here are some ideas, but would be good to see some code - stupid question: can't you use modeless dialogs? - what about GetParent() method - pass a pointer to the parent dialog to the child-> you can access it...

Making a long computation in a CDialog
Hello, I need to start a CDialog derived modal dialog which upon start will do a computation that might take some seconds and update a CEdit control while processing. I tried to place all my code in OnInitDialog with a message processor but it didn't write anything into the CEdit control: void PeekAndPump() { MSG Msg; while (::PeekMessage(&Msg, NULL, 0, 0, PM_NOREMOVE)) { AfxGetApp()->PumpMessage(); } } I could use another thread but I'm not sure how to make the interaction with the gui or maybe process it with a timer which has a short start period. The dialog w...

CDialog #4
Hi, I am working on a dialog based control. Properties of dialog derived from CDialog are - Style : Child, TitleBar : True. (It is a modeless dialog) Now when I try running this control. The titlebar appears grayish. How can i activate the child dialog titlebar. Please provide some pointers how should I go about this. Thanks, Sorry... need more information. Is the dialog part of another dialog (thus a child). It is unusual that a child dialog would have a title at all. Mostly a dialog is a child when it is a part of another window (dialog or view). If you intend for this to be a...

PropertySheet to CDialog
Gentlemen, I am trying to transform the following: m_pSheet=new CPropertySheet(); m_pSheet->AddPage(&m_InputPage); // where class CInputPage : public CPropertyPage to m_pDialog = new CDialog(); What is the equivalent to passing a class of type of class CInputPage : public CDialog soft of like the AddPage? Thanks, Yama Actually dialogs don't stack like property pages. If you want to do something like that you'll have to do it on your own something like: This website has lots of articles on working with child dialog windows: http://www.codeproject.com/dialog/ Thi...

how to closing a CDialog
I have a modal dialog that simply displays the status of loading a bunch of images into memory. In the OnInitDialog() a background thread is created to do the actual work. When the background thread is done, it posts a user message back to the dialog. That user message handler calls DestoyWindow() and the app GPF's! How do I close this darn dialog box? I have been away from MFC too long;) On Feb 23, 9:33 am, carto...@gmail.com wrote: > I have a modal dialog that simply displays the status of loading a > bunch of images into memory. In the OnInitDialog() a background > thre...

WM_KICKIDLE for modeless cdialogs
Hello, I have an application that updates it's UI using the WM_IDLEUPDATECMDUI for my main View (SDI CFormView) I also have some cdialogs that are displayed but they are not modal. I tried the use the WM_KICKIDLE message but they don't seem to receive this message. Is there any technique for my CDialogs to receive the IDLE messages? Now the main view directly calls to other dialog's onidle function in it's OnIdle message handler. It works fine, but the problem is that the other dialogs are not getting updated if the main view is closed and they don't received the WM...

CDialog as panel
Hello, I want to create a "panel". So I insert new dialog, delete the titlebar and add to this dialog new class (that derive from CDialog). Now, on the OnInitDialog of the main dialog I am writing: CNetManDialog *diag= new CNetManDialog(); diag->Create(IDD_NETMAN, this); return TRUE; Here the problems begin. First, the dialog is not "inside" my dialog. This is mean that his positions are absolute and not dependant to my window. So i add the line: diag->SetParent(this); and this problem is solve. But now, I have problems with focus. First, I must return FALSE ...

Text Update through CDialog and CFrame
I am running a program that requires a text update or maybe a progress bar of sort. My program is used to convert several files into one big file. Within the program it updates the Percentage of how much of the process is complete. I want to Show that Updated Percentage on CDialog and/or CFrame. And if this is possible also incorporate a progress bar. I have the text "update" through CFrame using CClientDC and having the program integrated into the CFrame Class I created. But the "update" is rather slow and when I resize the window or minumize and restore it the ...