I have the following file I need to open in a windows explorer window
C:\Users\Public\Documents\folder1\test.txt
So far opening this file using the above path is fine and I can read it as usual.
However when trying to open this this folder through Windows Explorer using wxExecute((wxChar **)cmd, wxEXEC_ASYNC, NULL);
where cmd is the above path(minus the file), It opens to my user documents.
I've tried various Windows API functions to get the path, some including where Public Documents has it's own ID and these still generate the path I already have. Are there any CLI options I can give to Windows Explorer so that it can actually open Public Documents without reverting to my User Documents folder?
First of all, why do you cast your string to wxChar**
? This just can't be right.
Second, you should be using wxLaunchDefaultApplication() instead of "raw" wxExecute()
in the first place (FWIW wxLaunchDefaultApplication()
is a straightforward wrapper for ShellExecute()
under MSW, while wxExecute()
is much more complicated).