Insert Link from File Changes Current Directory

Last reviewed: August 31, 1995
Article ID: Q109553
The information in this article applies to:
  • Microsoft OLE Libraries for Windows and Win32s, version 2.01

SUMMARY

The Open common dialog box changes the current working directory unless OFN_NOCHANGEDIR is specified. The UI Change Source dialog box depends on the change directory functionality, therefore, the Insert Object dialog box cannot be modified to change this behavior.

MORE INFORMATION

The Insert Object dialog box allows a user to insert a linked object into the container document from a file residing on disk. This action changes the current working directory to the drive and directory in which the file resides. If this file is located on a network drive and the network drive becomes unavailable after the link is established, any subsequent attempt to insert an embedded object will fail until the working directory is changed to a drive and directory that is accessible.

The problem materializes when the OLE 2.0 libraries attempt to WinExec a server application for a subsequent embedded object. In this situation, the call to WinExec fails because the current working directory is invalid.


Additional reference words: 2.01 OpenFile
KBCategory: kbole kbprg
KBSubcategory: LeTwoTls


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: August 31, 1995
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.