Click to See Complete Forum and Search --> : Long filenames


rafiki
April 19th, 1999, 02:10 PM
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

Paul McKenzie
April 19th, 1999, 03:37 PM
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

rafiki
April 19th, 1999, 04:51 PM
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(....)

ValerieB
April 19th, 1999, 06:57 PM
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
val@synthcom.com