Microsoft KB Archive/269128

= Problem occurs when you use MAPI functions before you call a procedure or a function =

Article ID: 269128

Article Last Modified on 5/17/2004

-

APPLIES TO


 * Microsoft Messaging Application Programming Interface

-



This article was previously published under Q269128





SYMPTOMS
When you call a procedure or a function by using only the file name instead of including the path name together with the file name, the procedure or the function searches for the file in the current working directory. The current working directory is first set to the directory where the executable file resides. However, if you use MAPI functions before a procedure or a function is called, an error may occur.



CAUSE
This problem occurs because of the way that MAPI loads its DLLs. When MAPI loads the supporting DLLs from a folder, MAPI changes the working directory.



RESOLUTION
When a file name is passed to a procedure or to a function, use the full path name together with the file name. Alternatively, you can use the GetCurrentDirectory function and the SetCurrentDirectory function to keep and to restore the current working directory.



STATUS
This behavior is by design.



MORE INFORMATION
For additional information, click the following article number to view the article in the Microsoft Knowledge Base:

244343 Microsoft MAPI control changes the current working directory

Additional query words: path found mapi

Keywords: kbprb KB269128

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.