LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

file selection popup

hi i am using file selection popup to get a file selected..
but i want the directory of the file selected..
is there anyway to retrieve the directory of the file selected ....
 
0 Kudos
Message 1 of 5
(3,393 Views)
SplitPath function should be what you need for it.


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,390 Views)

thanks robert..but i am working in VC++ using LCVI as Front end/user interface..

so wat can i do if i want to split directory from path in VC++ ..

0 Kudos
Message 3 of 5
(3,386 Views)

You could always try something based on the ANSI function strrchr (). Perhaps:

    char *ptr;

    if (ptr == strrchr (copy_of_filename, '\\'))    // Find the last directory separator
        *ptr = 0;                                   // Terminate the string there, if it exists

This will alter copy_of_filename to become just the directory part.

JR

Message 4 of 5
(3,371 Views)

I don't see any reason why you can't use the CVI function, you are already importing CVI stuff for the UI, so why not a few more functions if you need them?

The first virtue of the programmer is laziness, reuse code that is already written instead of writing your own.

Martin Fredrickson
Test Engineer

Northrop Grumman
Advanced Systems and Products
San Diego, CA 92128
0 Kudos
Message 5 of 5
(3,353 Views)