LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How does one use "FFlattenPath()" ?

Hi,

I am programming a DLL for use with a Code Library VI.

One procedure in this DLL gets a LabVIEW Path as a parameter.

So far so good:

FNamePtr(path, strptr) gives the proper filename, etc. FExists(path) reports the file exists, and is a file, as expected.

However: I need the full path and filename written to a conventional C-string, so that this can be passed to another function.

I think FFlattenPath() is meant to do this, but it does not work.

I have:

...
fprintf(file, "len = %d\n", FFlattenPath(filepath, 0));
FFlattenPath(filepath, filenameP);
PToCStr(filenameP, filenameC);
fprintf(file, "file = %s\n", filenameC);
...

Two problems:

- the debugging text "len = %d" does not show the correct leng
th.

- the filename written to the debug file is also very incorrect.

How is one supposed to use this function?

Thanks,

Kevin
0 Kudos
Message 1 of 4
(3,047 Views)
Kevin,

I'm not clear on your question, but if you are trying to input a path into C as a string, just use the path to string conversion function in LabVIEW to convert the path to a string.

If your question is on how to convert a path to a string in C in your DLL, I can't help you there, as I'm not yet familiar with C.

So, if you are trying to get a path into your DLL, you have the answer, otherwise...

-Mike Du'Lyea
Advanced Test Engineering
http://advancedtestengineerin
Message 2 of 4
(3,047 Views)
Okay, I read it again, and again, and again....

It seems you are trying to read a Path from LabVIEW and convert it to a string in C.

Just convert it to a string in LabVIEW, and operate on it in C as a string.
Message 3 of 4
(3,047 Views)
I would like to get information about the file as well - permissions, etc. I wanted to the use C-functions such as FGetInfo() [I think its called - not at a LabVIEW station now] on the Path.

I could pass both the path AND the converted string to my procedure, but thats not very pretty.
0 Kudos
Message 4 of 4
(3,047 Views)