LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Wrong file name received by my application

Hello,
 
When a file with the extension *.log_c is double-clicked, it is automatically opened by my application (I acheived this by adding some registry values). The pathname of the opened file is then received in the variable argv[1] of the main function of my application. However, on most systems it seems that the string I receive is not the same of the pathname, but some abbreviation that reminds me of DOS, where a file name or a directory could only be 8 characters, and a file extension could only be 3.
E.g: when I open the file C:\Documents and Settings\Wim\My Documents\LabWindows\DebugLogDecoder\dbg_20060621_114839.log_c, the string that I receive is C:\DOCUME~1\Wim\MYDOCU~1\LABWIN~1\DEBUGL~1\DBG_20~1.LOG
 
This problem occurs on some machines. On other machines argv[1] contains the correct pathname.
 
Why is that and how can I solve this problem?
Thanks for all help,
 
Wim
0 Kudos
Message 1 of 5
(3,057 Views)
Wim, the reason why on some system the long file is passed to the program and on some others the short one will probably reside in some non-evident option of Windows Smiley Sad that I don't know at present.
However, GetLongPathName windows API should help you to retrieve the long file name associated to the received command-line parameter.Smiley Wink


Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
Message 2 of 5
(3,054 Views)

Hello Roberto,

thanks a lot for the info, I will try it immediately.

BTW:  congratulations with your 1000 posts! You have been helping me out since the day I discovered this forum. I really appreciate it Smiley Wink

Message Edited by Wim S on 06-21-2006 03:03 PM

0 Kudos
Message 3 of 5
(3,050 Views)
OK, this works great. Thanks a lot!
0 Kudos
Message 4 of 5
(3,042 Views)
I'm happy to have helped you! Smiley Happy


Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 5 of 5
(3,038 Views)