CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 1999
    Posts
    43

    CDocument::GetPathName()

    I need to call the CDocument::GetPathName() from my CEditView class. How do I do this? Everytime I try this the compiler gives me an error:

    illegal call of non-static member function

    I am trying to do it like this:

    CString strReturn;

    strReturn = CDocument::GetPathName();

    What is the function GetPathName? Protected? How do I use this function from another class? Thanks for your help.

    Todd
    [email protected]



  2. #2
    Join Date
    Apr 1999
    Posts
    4

    Re: CDocument::GetPathName()

    Hi, Todd

    What seems to be happening here is that you must call it in a different way: you must obtain a pointer to the active document (something like GetDocument(), I don't remember) ant do like this:
    CDocument *p = GetDocument() (check the correct call!)
    CString strReturn;
    strReturn = p->GetPathName();

    That should work. :-)


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