Kbase P40890: The creation of a MAPI SESSION changes the working directory
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  9/5/2003 |
|
Status: Unverified
SYMPTOM(s):
Using the Microsoft MAPI Control from Progress 4GL.
Calling the MAPISendMail function in MAPI32.DLL using the Progress DLL interface.
The working directory changes without any warning.
CHANGE:
Installed Microsoft Outlook 2000 or Internet Explorer 5.
CAUSE:
This is a Microsoft issue with the MAPI32.DLL.
FIX:
In order to maintain the default directory and still use MAPI functionality, store the current directory into a local variable before doing MAPI processing. Then, after the completion of MAPI processing, set the working directory back to what it was using the value stored in the defined local variable. e.g.:
DEFINE VARIABLE szOriginalDirectory AS CHARACTER.
FILE-INFO:FILE-NAME = ".".
szOriginalDirectory = FILE-INFO:FULL-PATHNAME.
/* do MAPI stuff */
RUN SetCurrentDirectoryA(szOriginalDirectory).
PROCEDURE SetCurrentDirectoryA EXTERNAL "kernel32.dll":U:
DEFINE INPUT PARAMETER newdir AS CHAR.
END.