CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7

Thread: help need

  1. #1
    Join Date
    Jul 2006
    Posts
    3

    Question help need

    Hi experts,

    I have problem about the CFileDialog in a property page in the program which is Htmlview as the base view. The CFIleDialog does not work in a property page in this program, the AfxMessageBox does not work either without a button clicking. Who can tell me how to do it. You are appreciated very much in advance if you are kind enough to help me.

  2. #2
    Join Date
    Feb 2000
    Location
    San Diego, CA
    Posts
    10,354

    Re: help need

    It is not clear what the problem is. Please describe in more detail. For e.g. are you doing a CFileDialog object DoModal on click of a button ?
    And what's the deal with AfxMessageBox() ? How do you call.

    Any code snippet related to the problem would help

  3. #3
    Join Date
    Jul 2006
    Posts
    3

    Re: help need

    Hi Kirants,
    Thank you very much for your answer ! The following function is in a property page. When I click a button called 'select files', the function should work, a file open dialog should be popuped. In fact, there is no any popup dialog, and the program hangs. The program stop at the point --fdlg.DoModal(), and from the debugging info, m_hWnd of fdlg is NULL.

    void CNewData::OnOpenFile()
    {
    char FileName[255];
    CString cst;

    CFileDialog fdlg(TRUE, NULL, NULL, OFN_HIDEREADONLY |
    OFN_ALLOWMULTISELECT, "All Files (*.*)|*.*|Data Files
    (*.dat)|*.dat|Text Files (*.txt)|*.txt||", NULL );

    fdlg.DoModal();
    .......
    }

    Thank you for your time !

    Jie
    Last edited by kingjie; August 1st, 2006 at 03:00 PM.

  4. #4
    Join Date
    Oct 2002
    Location
    Timisoara, Romania
    Posts
    14,360

    Re: help need

    Are you sure the function is actually called? Put a breakpoint and make sure of it.
    Marius Bancila
    Home Page
    My CodeGuru articles

    I do not offer technical support via PM or e-mail. Please use vbBulletin codes.

  5. #5
    Join Date
    Jul 2006
    Posts
    3

    Re: help need

    Dear Cilu:

    Thank you for your time. I put breakpoints and the function was called, the program was just hanged at the point of calling DoModal().

    Thanks again.

    Jie

  6. #6
    Join Date
    Oct 2000
    Location
    India
    Posts
    4,620

    Thumbs up Re: help need

    Hi,

    Can u zip your code and upload it here so that we can take a look at it ?
    All luck and have a great day.

    Regards,
    V.Girish

    Visit www.geocities.com/contactgirish for Source code, Tutorials, FAQs and Downloads.

  7. #7
    Join Date
    May 2005
    Location
    Oregon
    Posts
    3,725

    Re: help need

    try this.
    Code:
    CFileDialog fdlg(TRUE, NULL, NULL, OFN_HIDEREADONLY | OFN_ALLOWMULTISELECT, "All Files (*.*)|*.*|Data Files (*.dat)|*.dat|Text Files(*.txt)||", NULL );
    	fdlg.DoModal();
    if Still problem Please post your Zip File here.

    Thanx

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured