Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Internet Connection Wizard Keeps popping up in MAPI
Message
From
23/07/2003 03:13:03
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Internet Connection Wizard Keeps popping up in MAPI
Miscellaneous
Thread ID:
00812666
Message ID:
00812666
Views:
80
I have a VFP program that sends documents via MAPI.

This runs on about 20 pcs just fine.

However on one Windows 2000 pc the Internet Connection Wizard keps popping up and halting the send process.

This wizard gets fired during the MAPI signon in CUSMAPI Create Session.

I have tried re-installing the application and I have re-run the foxreg util to make sure everything is registered ok.

The one thing I have not yet done is to get the network boys to re-install outlook.
The offending line is near the bottom of the large code snippet I have pasted.

A possible hint may be in the following line which fires just after the problem line
SET DEFAULT TO (lcOldFolder)
lcOldFolder Is pointing to the Outlook Express folder instead of Outlook which is odd since we are using Outlook.

Is it possible that this users system thinks Outlook Express is the default client for MAPI

If so how can I change this?

Many Thanks
**************************************************
* Creates a session from UserName and Password
*
* Populates object reference and returns session id
*
**************************************************

LPARAMETERS lcUserName, lcPassword, llDownloadMail

LOCAL lnHandle, lnProfiles, lnDataSize, lcDefaultProfile

DECLARE INTEGER RegOpenKeyEx IN Win32API ;
	INTEGER nStartHandle, ;
	STRING cKeyToOpen, ;
	INTEGER nReservedZero, ;
	INTEGER nSecurityAccess, ;
	INTEGER @nOpenHandle

DECLARE INTEGER RegQueryValueEx IN Win32API ;
	INTEGER nOpenHandle, ;
	STRING cValueToQuery, ;
	INTEGER nReservedZero, ;
	INTEGER nValueType, ;
	STRING @cDataBuffer, ;
	INTEGER @nSizeOfData	
	
DECLARE INTEGER RegQueryInfoKey IN Win32API ;
	INTEGER nOpenHandle, ;
	STRING cClassString, ;
	INTEGER nSizeOfClassString, ;
	INTEGER nReservedNull, ;
	INTEGER @nSubKeys, ;
	INTEGER nLongestSubKey, ;
	INTEGER nLongestClass, ;
	INTEGER nValues, ;
	INTEGER nLongestValueName, ;
	INTEGER nLongestValueData, ;
	INTEGER nSecurityDescriptor, ;
	INTEGER nLastWriteTime

STORE 0 TO lnHandle, lnProfiles
STORE 254 TO lnDataSize
STORE SPACE(lnDataSize) TO lcDefaultProfile
*- Open the MAPI Profiles key
RegOpenKeyEx(-2147483647, "Software\Microsoft\Windows Messaging Subsystem\Profiles", 0, 0, @lnHandle)
*- Find out how many profiles exist
RegQueryInfoKey(lnHandle, "", 0, 0, @lnProfiles, 0, 0, 0, 0, 0, 0, 0)

IF lnProfiles>1
	*- Identify the default profile
	RegQueryValueEx(lnHandle, "DefaultProfile", 0, 0, @lcDefaultProfile, @lnDataSize)
ENDIF

lcOldFolder=SYS(5)+SYS(2003)
IF TYPE("THIS.oSession")='O'
	IF THIS.oSession.UserName=lcUserName ;
			AND THIS.oSession.Password=lcPassword
		RETURN THIS.oSession.SessionID
	ELSE
		THIS.oSession.SignOff()
	ENDIF
ENDIF
THIS.oSession=CREATEOBJECT("MSMAPI.MAPISession.1")
IF lnProfiles=>1
	*- Create new session if multi-profile
	This.oSession.NewSession=.T.
ENDIF
THIS.oSession.UserName=lcUserName
IF lnProfiles=>1 AND EMPTY(lcUserName)
	*- Use default profile if no profile specified
	This.oSession.UserName=lcDefaultProfile
ENDIF
THIS.oSession.Password=lcPassword
THIS.oSession.DownloadMail=llDownloadMail
THIS.oSession.SignOn()     && this fires the Internet Connection Wizard!
SET DEFAULT TO (lcOldFolder)   && why is this poiting to Outlook Express when we use Out Look?

RETURN THIS.oSession.SessionID
Next
Reply
Map
View

Click here to load this message in the networking platform