Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Open Folder in Windows

Status
Not open for further replies.

schwarem

Programmer
Apr 18, 2002
159
0
0
US
I have a Windows Form application using C++ .Net. How do I open up a folder in Windows from my C++ code? I have a variable outputDirectory that contains a string of the path.
 
I tried the code below, but I am getting a compile error.

Code:
ShellExecute (NULL, "explore" ,outputDirectory, NULL, NULL, SW_SHOWNORMAL);

I get the error below:
error C2664: 'ShellExecuteW' : cannot convert parameter 2 from 'const char [8]' to 'LPCWSTR'
 
You have UNICODE mode in your project. Try L"explore".
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top