Click here to Skip to main content
15,890,506 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi I need to assign initial directory Path for CFileDialog as network path that contains IP Address like
"\\\\192.168.1.1\\Log"
The member used to assign the path does not work in this regard...as given below:
CFileDialog.m_ofn.lpstrInitialDir = _T("\\\\192.168.1.1\\Log")

Kindly let me know the solution in this regard
Thanks

What I have tried:

I have tried like this:
C++
CFileDialog.m_ofn.lpstrInitialDir = _T("\\\\192.168.1.1\\Log")
Posted
Updated 19-Jun-19 6:15am
v2
Comments
Richard MacCutchan 18-Jun-19 9:05am    
You need to reference the location as a Windows mapped drive letter.

1 solution

can you access that directory via file explorer? If not than programmatic approach will fail also.

this code should not compile
CFileDialog.m_ofn.lpstrInitialDir = _T("\\\\192.168.1.1\\Log")

and on the other hand this will create an inaccessible temporary variable
CFileDialog().m_ofn.lpstrInitialDir = _T("\\\\192.168.1.1\\Log")


also unicode paths formed like so:

L"\\\\?\\My Folder"
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900