Golden Lab Software, Inc.

Text Box: Tech Blog  
——————————————————————————————————————————-
Terminal Server 2008 x64 Bit   - File in Use
5/13/10

We have a client that is running a 32-Bit application that recently upgraded to Windows Terminal Server 2008 64-Bit.  The application ran okay in tests with 3-4 users running the application in different sessions.   However, once they moved the rest of the users to this server, most of them were unable to run the application.   The first 3 to 6 users that started the application were okay, but subsequent ones were blocked out.    Luckily this application is configured with a launcher application that is only 64K that calls other applications.    Only the initial launcher application was being blocked.    We found that we were able to copy the launcher and the other users were able to start the system using this copy.  

 However, after 3 to 6 users started the copy of the launcher, they also started being blocked.   This appears to be a problem with how Windows creates a virtual 32-Bit environment on the 64-bit OS.   Windows appears to share the files and/or file handles between different sessions of the 32-Bit virtual environment. 

The brute-force work around for this was to create a separate launcher application for each user. 
——————————————————————————————————————————-
CDO Error
4/18/07
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. 

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.      Click here for sample code
——————————————————————————————————————————-
MSMAPI Error “Unspecified Failure has occurred.”
2/07/07
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.
——————————————————————————————————————————-
MSMAPI Error “Class is not licensed for use”
10/17/06
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 suggested 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 sub-classed, they can be used on the "non-licensed" computer.
——————————————————————————————————————————-
FoxPro—Adding a backslash “\” into a listbox
10/12/06
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.
——————————————————————————————————————————-
FoxPro Datasession problem
10/12/06

We did some testing on Foxpro Datasession problems we have seen.   What we found is that FoxPro can get confused and the results are not always consistent.   First we tested the code sample submitted earlier for class types other than "Custom".   What we 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.   You would expect this behavior if the object type was "Session" or if private data sessions had been set.   However, in all other scenarios, you 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 we 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.    We 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, one 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, we disproved this by running the code without handling any data.
——————————————————————————————————————————-
FoxPro Bug on Class type CUSTOM? 
4/11/05 
We ran into a problem today with Visual Foxpro 8 SP1 that we 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.    Click here for sample code
——————————————————————————————————————————-
Text Box: PRODUCTS
SHIPSUITE (Shipping Integration)
CUSTOM MENU EXTENDER
AP 1099  ADJUSTMENT UTILITY
POSITIVE PAY
PROSEND (Automatically send Invoices and Statements)