Enhancements
Custom Development
ERP Products

Altas' Blog

Blogs


4/18/2007
CDO Error
Error Messages: "Server Response: 550.5.7.1 Unable to relay for" and "Server Response not available"

We ran into these errors trying to send emails using CDO using Foxpro. We found that these errors were because the SMTP server we were connecting to required authentication. When sending email in Outlook, this is set using "My outgoing server (SMTP) requires authentication". However, in CDO, you must send the SMTP account and password.

Some SMTP servers may also require SSL. In Outlook, this is the setting "This server requires an encrypted connection (SSL)". The following link shows a code example for both scenarios.
Example Code

2/7/2007
MSMAPI Error
Error Message: OLE IDispatch exception code 0 from MAPIMessages: Unspecified Failure has occurred.

We were trying to send emails with only a subject line and an attachment. However, it appears that MAPI requires the message to have a body as well. Trying to send a message without a body generated the error above.

10/12/2006
MSMAPI Error
Error Message: OLE Error Code 0x80040112 - Class is not licensed for use

We ran into this error trying to run the command:
loSession = CREATEOBJECT( "MSMAPI.MAPISession" )
We had used this command on several other computers that had Outlook Express installed and never had a problem. This installation of Outlook Express appeared to be no different. The MSMAPI32.OCX was in place and appeared to have the correct license information in the registry. After some fustration, we went looking for a work-around. We found several Internet posts that sugested adding the ActiveX controls onto a form or class, instead of calling the control directly. This worked, but one word of caution, when you add the control to a form, we found that you must be on a computer that doesn't have the problem above or you won't be able to add the ActiveX controls. However, once the controls have been subclassed, they can be used on the "non-licensed" computer.

7/5/2005
Foxpro - Adding a backslash ("\") into a listbox
In Microsoft's help, they state that if you need to show a backslash in a listbox or combobox, you must enter it as two backslashes "\\". So if you wanted to show the printer "\\Mycomputer\Myprinter", you would have to enter this as "\\\\MyComputer\\MyPrinter". However, in testing this in VFP8, this advice does not work. I am using a RowSourceType of "ARRAY" for a Combobox. The resulting line shows as disabled with the following text "\\\MyComputer\\MyPrinter".
I found a work around for this. If I enter the text as " \\MyComputer\MPrinter" and place a space as the first character, the line will show correctly in the list.

4/14/2005
More on Foxpro Datasession
I did more testing on the Foxpro Datasession problems. What I found is that Foxpro can get confused and the results are not always consistent. First I tested the code sample submitted earlier for class types other than "Custom". What I found was that it did not matter what class type you choose, Foxpro will try to "protect" the datasession of the calling object. So if you change the datasession in a child object (non-private datasession), the datasession changes back when control is returned to the calling object. I would expect this behavior if the object type was "Session" or if private data sessions had been set. However, in all other scenarios, I would expect a procedure called in another object to have the same results as a call to a stand-alone procedure. However, this is not the case

One other strange result that I found is that Foxpro can get confused on how it maintains the "correct" datasession. In our framework, we instantiate an object of type "Custom". Within this parent object, we instantiate objects of type "Form", "Session", and "Custom". After the "Session" object is created, we change the datasession for our parent object from DataSession = 1 to DataSession =2. While the form is displayed, we have code that will process the Esc key and run code to release all of the objects above. Just before we destroy these objects, we set the Datasession = 1. I then have DEBUGOUT code that shows the datasession is equal to one throughout the release process. However when running the code the first time, after the release, the datasession will flip back to Datasession = 2. However, I can run the same code 100 more times, the datasession will stay on Datasession = 1 after the release.

Some have suggested that Foxpro may be trying to flip the datasession back because there are unprocessed records. However, I disproved this by running the code without handling any data.

4/11/2005
Foxpro Bug on Class type CUSTOM?
Ran into a problem today with Visual Foxpro 8 SP1 that I have since reported to Microsoft.

The "CUSTOM" class improperly manages the data session. If you call a object of type CUSTOM, and you change the datasession in that call, the datasession should not change on return from that call.

In the attached scenario, an Object of type CUSTOM is calling another object of type CUSTOM in order to change the datasession. The datasession is changed from datasession #2 to datasession #1 in the call. However, when control is returned to the calling object, the datasession is automatically switching back to datasession #2.

You can see an example below: Look for the DEBUGOUT code for where the problem occurs.
Example Code
News Briefs


2/7/2007
Sage Pro 7.4 has been released

9/1/2006
Golden Lab celebrates its 6th year!

4/8/2005
GLS Products are now certified for Red Hat Linux!
   About Us    Atlas' Blog

© 2001-2007 Golden Lab Software, Inc. All Rights Reserved