open_dialog, filename, filepath

Feb 5, 2013 at 3:27pm

open_dialog, filename, filepath

Hi all,

I’m a bit confused because of the Max API (for C-external programming).

When calling the open_dialog message:
short open_dialog(char *name, short *volptr, long *typeptr, long *types, short ntypes);

I only get the actual name of the file and not the complete path. In the documentation they say that the path is handled separately in a path ID (in this case the short *volptr), but how do I get the actual path as a character out of this?

Thanks in advance

#66358
Feb 5, 2013 at 4:04pm

Hi,

?

void flop_bang(t_flop *x)
{
    long k;
    char fullpath[MAX_PATH_CHARS];
    char filename[MAX_FILENAME_CHARS];
    short path = 0;

    if (!(open_dialog(filename, &path, &k, NULL, -1)) &&
        !(path_topathname(path, filename, fullpath))) {
        post("%s", fullpath);
    }
}
#238867

You must be logged in to reply to this topic.