Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here.


Call this member function to open a file on a gopher server.

CGopherFile* OpenFile(
   CGopherLocator& refLocator,
   DWORD dwFlags = 0,
   LPCTSTR pstrView = NULL,
   DWORD_PTR dwContext = 1 



A reference to a CGopherLocator object.


Any combination of INTERNET_FLAG_* flags. See CInternetSession::OpenUrl for further information on INTERNET_FLAG_* flags.


A pointer to a file-view string. If several views of the file exist at the server, this parameter specifies which file view to open. If pstrView is NULL, the default file view is used.


The context ID for the file being opened. See Remarks for more information about dwContext.

A pointer to the CGopherFile object to be opened.

Override the dwContext default to set the context identifier to a value of your choosing. The context identifier is associated with this specific operation of the CGopherConnection object created by its CInternetSession object. The value is returned to CInternetSession::OnStatusCallback to provide status on the operation with which it is identified. See the article Internet First Steps: WinInet for more information about the context identifier.

Community Additions

© 2015 Microsoft