Problem occurs when you use MAPI functions before you call a procedure or a function (269128)



The information in this article applies to:

  • Microsoft Extended Messaging Application Programming Interface (MAPI)

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


Modification Type:MajorLast Reviewed:5/17/2004
Keywords:kbprb KB269128 kbAudDeveloper