Visual FoxPro MSMapi session.signoff() causes error
-
Sunday, February 19, 2012 9:02 PMOS: Windows 7 Professional 64-bit
I have a Purchase Order application, written in VFP50, that allows a user to automatically generate an email, using their default email client, and edit the email prior to sending out to a vendor. This is the code that creates the email:
local lSession,lMessages
lSession = createobject("MSMAPI.MAPISession")
lSession.Signon()
if (lSession.SessionID >0)
lMessages = createobject("MSMAPI.MAPIMessages")
lMessages.SessionID=lSession.SessionID
endif
with lMessages
.Compose()
if len(csupemail)>0
.RecipIndex=1
.RecipAddress=csupemail
.RecipType=1
endif
.RecipIndex=2
.RecipAddress='xxxxxxxxx@xxxxxx.com'
.RecipType=3
.AttachmentPathName=attachfile
.MsgSubject="Purchase Order "+trim(csearch)
.MsgNoteText=cmessage
.Send(.T.)
endwith
lSession.Signoff()
This has worked for many years with no problem under Windows XP. I am testing the application on a new Windows 7 64-bit machine. The application runs fine except for this one part which produces an unspecified Windows error and terminates VFP. The Signoff() command appears to be the culprit. I can type the following three commands into the VFP command window, and watch the signoff() command cause the problem (there is NO error under XP):
lSession = createobject("MSMAPI.MAPISession")
lSession.Signon()
lSession.Signoff()
I have spent several days searching for a solution before posting here. Any help would be greatly appreciated.
Thanks
All Replies
-
Sunday, February 19, 2012 9:13 PM
Visual Foxpro 5 is not compatible with Windows 7. You will have to update your application with Visual Foxpro 9.
Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. ”
- Proposed As Answer by Niki HanMicrosoft Contingent Staff, Moderator Tuesday, February 21, 2012 2:52 AM
- Marked As Answer by Niki HanMicrosoft Contingent Staff, Moderator Thursday, March 01, 2012 9:37 AM
-
Tuesday, February 21, 2012 3:50 AM
Thanks Rick, but due to the cost and fact that Visual Foxpro has been discontinued, updating to version 9 is not an option.
-
Tuesday, February 21, 2012 6:32 AMModerator
Hi,
I notice it is a development issue, please contact MSDN forum to get more assistances.
Visual FoxPro General
http://social.msdn.microsoft.com/Forums/en/visualfoxprogeneral/threads
Niki Han
TechNet Community Support

