홈 · 개발 참고자료

개발 참고자료

[파워빌더] Use the default MAPI profile

작성자
관리자
작성일
2016-10-16
조회
11438
분류
파워빌더
// Win NT
MailSession lms_mSes

lms_mSes = CREATE MailSession
li_rc = RegistryGet( &
"HKEY_CURRENT_USER\Software\Microsoft\Windows NT\" &
+ "CurrentVersion\Windows Messaging Subsystem\Profiles" , &
"DefaultProfile", RegString!, ls_profile )
// Win9x,
// "HKCU\Software\Microsoft\Windows Messaging Subsystem\Profiles"

IF li_rc = FAILURE THEN
// no registry entries for default MAPI profile
RETURN -1
END IF
lms_mSes.MailLogon(ls_profile, "", mailNewSession!)

Calling the MailLogon change the current directory so it's a good idea to keep the current directory before making the call and restore it after.


Using the PFC, this should like this :


n_cst_filesrv lnv_fsrv

f_SetFileSrv(lnv_fsrv, TRUE)
ls_path = lnv_fsrv.of_GetCurrentDirectory()

// MAPI stuff

lnv_fsrv.of_ChangeDirectory(ls_path)
f_SetFileSrv(lnv_fsrv, FALSE)