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

Thread: Long filenames

  1. #1
    Join Date
    May 1999
    Posts
    19

    Long filenames

    Hi
    VERIFY(wmfDC.Create("c:\\My Documents\\ppp.wmf")) gives assertion error
    VERIFY(wmfDC.Create("c:\\temp\\ppp.wmf")) does not
    so Create function does not support long filenames?? cuz there is no any other fails...
    thanx alot


  2. #2
    Join Date
    Apr 1999
    Posts
    27,449

    Re: Long filenames

    Test by eliminating the space from "My Documents":

    VERIFY(wmfDC.Create("c:\\MyDocuments\\ppp.wmf"));

    If this works, the problem is the space in the "My Documents". You may need to surround the path in quotes if you want to include the space:

    VERIFY(wmfDC.Create("\"c:\\My Documents\\ppp.wmf\""))

    Many programs have the bug/feature of having to specify quotes around paths and file names that have spaces.

    Also, what was the assertion error?

    Regards,

    Paul McKenzie



  3. #3
    Join Date
    May 1999
    Posts
    19

    Still does not work

    You know, it does not work also on directory names more than 8 chars, not only on space included pathe names...
    I am using VC 5.0
    it works on VERIFY(wmfDC.Create("c:\\aaa\\ppp.wmf"));
    and does not work on
    VERIFY(wmfDC.Create("c:\\aaaaaaaaaaaaaaaaaa\\ppp.wmf"));
    I Have tryed VERIFY(wmfDC.Create("\"c:\\My Documents\\ppp.wmf\"")) but got the same error...
    thank you for reply

    P.S.
    The error was not Assertion sorry, it was Verification error -> VERIFY(....)


  4. #4
    Join Date
    Apr 1999
    Location
    Portland, OR, USA
    Posts
    18

    Re: Long filenames

    There is a way to convert from a long file name to a short file name. Use the function GetShortPathName(). I think that there's one small catch... if you're trying to get the path name to a file or directory that doesn't exist, I think the call fails. I don't remember exactly though. You'll have to try it out. You can use GetLastError() to find out why it failed.

    Good luck!

    Valerie Bradley
    http://www.synthcom.com/~val
    [email protected]

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