| | Sun | Mon | Tue | Wed | Thu | Fri | Sat | | 24 | 25 | 26 | 27 | 28 | 29 | 1 | | 2 | 3 | 4 | 5 | 6 | 7 | 8 | | 9 | 10 | 11 | 12 | 13 | 14 | 15 | | 16 | 17 | 18 | 19 | 20 | 21 | 22 | | 23 | 24 | 25 | 26 | 27 | 28 | 29 | | 30 | 31 | 1 | 2 | 3 | 4 | 5 |
Search
Navigation
Categories
Blogroll
Other Stuff
|

Sunday, March 02, 2008
Visual FoxPro 9.0 SP2 or not... Post 1
There has been a lot of talk about the state of Visual FoxPro 9 SP2. It seems like many people are not willing to upgrade unless the issues introduced in SP2 get fixed. There also seems to be some confusion about what the SP2 issues encompass; VFP9, Sedna, VFPx, etc… I plan to go through these issues over the next few days to help dispell some of the confusion and offer what solutions I can to the known issues.
Why do this? Mainly because I think many people are wrongfully swayed away from SP2, Sedna, VFPx and Visual FoxPro in general for the wrong reasons. The fix list for SP2 includes a long list of fixes that have been around for years. I think the VFP team did a great job of addressing as many issues as they could using what limited resources they had available. The unfortunate part is the limited testing this service pack received which led to a few new issues being introduced.
Right now there is a list of issues and solutions being tracked on the Visual FoxPro Wiki. Of the 20 issues that are posted (as of this writing) I would break down into the following categories:
New bugs in the VFP9 Core
New bugs in the VFP9 Xsource
New bugs in the VFP9 Help File
I would define the “Core” as the VFP9.EXE and the distributable runtimes (VFP9R.DLL, VFP9T.DLL, VFP9RENU.DLL etc…). To me, these are the most critical issues and really the only ones to be overly concerned about. Mainly because we do not have the ability nor the rights to make changes to this part of the application.
Issues with the Xsource are not as critical because we have all of the source code for these modules and they can be updated as needed. They are even posted on VFPx and can me managed and distributed from a central location with timely updates.
I would not consider the “Help File” issues as super critcal either, for a few reasons, the most significant being that Microsoft is in the process of fixing the Help file. Special thanks to Bernard Bout for reporting these issues and being available to test the updates that are being worked on. The other reasons go along with the XSource reasons. If worst came to worse, the help file can be decompiled and we can fix it and recompile it ourselves. But in the interim we can just use the Help file from SP1, or live with it, for now. ALL of the help topics are included with the help file, the issue is missing index entries.
The 20 reported issues break down as follows:
Core – 6 issues
Xsource – 2 issues
Help File – 1 issues
Other – 11 issues
Note that as I go through these, over the next few days, some of the categories may get moved around. But at first look, this is where the issues seem to fall. The “Other” category includes issues that were not introduced in SP2, but rather issues that have been around before SP2 or are unexpected behavior, not really a bug. I don’t mean to belittle these issues here. These “other” issues should be addressed, and I will go through them, but since this writting is about upgrading to SP2, I think they should be broken out and excluded as reasons to not upgrade to SP2.
Also note that most of these issues are related to reporting. Most, if not all of them are in the “core” product and have nothing to do with the Reporting APPs. As a matter of fact, many people are using the Reporting APPs from SP2 with VFP9 SP1 and are quite happy with them. There were MANY new features added to the SP2 reporting APPs that are worth taking a look at, even if you don’t upgrade to SP2.
I promise to go into more detail in my next post. But this will give you an idea of where I’m headed and what to look forward to.
I feel very strongly that everyone should upgrade to SP2 and then determine if YOU have a real business case for NOT upgrading your clients. Rick Schummer has published a white paper on how to have SP1 and SP2 installed on the same development machine. If everyone sits around and waits for an SP3, we are going to be in big trouble. We need a definitive list of SP2 bugs so we can either determine an appropriate workaround or encourage Microsoft to follow up with their promise of support through 2014.
If you have found an issue with VFP (and it is still broken in VFP9 SP2) please report it to Microsoft, especially if it is in the “core” product. Also, if it appears to be SP2 specific, please add it to the SP2 Bug list on the Visual FoxPro Wiki and someone in the community, including myself, will try to address it.
Sunday, March 02, 2008 11:46:06 PM (Eastern Standard Time, UTC-05:00)
SP2 | VFP Development

Wednesday, February 20, 2008

Friday, January 11, 2008
Wrapped Text with GDIPlusX
I was recently asked if it was possible to do "Wrapped Text" with GDIPlusX. I wasn’t sure what they meant at first, but found out they wanted a text string to render in the form a circle, instead of a straight line. While there is nothing built into the library that can do this, I knew it was possible to write your own code to get this functionality.
I dug around and found an excellent article written by Sjaak Priester. He came up with a very interesting technique. By using the FlattenPath method of a GraphicsPath and some straight forward geometry, he was able to not only get a text string to render in a circle, but to get a text string to render in any shape by using a GraphicsPath as a guide. He developed a very nice little C++ class to handle this. I was impressed by the simple yet powerful technique he was using, I decided to try it using the GDIPlusX library.
The results are attached. A relatively straight forward, 300+ line class that takes a GraphicsPath guide, a String of text and a Font and fills a second GraphicsPath with the rendered string, following the specified path. Once you have this rendered path, you can do all kinds of cools stuff with it (check out some of the text effect samples with the GDIPlusX samples download).
Included in this download is the WrappedText class, a demo form as well as the 1.10 version of the GDIPlusX library (compiled into an app). To run the demo, issue a:
DO FORM WRAPPEDTEXTDEMO
WrappedTextDemo.zip (210.63 KB)
Friday, January 11, 2008 7:56:52 AM (Eastern Standard Time, UTC-05:00)
The GDIPlusX Library Has Been Updated...Into Production
The GDIPlusX library, part of the VFPX project, has been updated and moved into production status. Rumor has it that many people were using it in a production environment already (including myself) but now its official.
With this release we have added SYSTEM.APP. This APP includes the entire library in a single distributable. Rick Strahl made this recommendation at SWFox and we liked the idea. Of course, if you prefer to compile the library into your own application, you can do still do that also. All of the source is still downloadable from VFPX.
A few other features were packed into this release based on feedback that we have received in the past few months. We would like to thank Christof Wollenhaupt, Alan Stevens, Carlos Alloatti, several members of the Foxite message board and of course Craig Boyd for your valuable contributions. Special thanks to Cesar Chalom for all of his efforts in this last release. Most all of the new enhancements were added by Cesar as well as several cool new samples…if you haven’t downloaded it yet, you should really check it out as well as the other great projects on VFPX.
Friday, January 11, 2008 7:12:44 AM (Eastern Standard Time, UTC-05:00)

Wednesday, August 15, 2007
An updated version of the GDIPlusX library has been posted
It has taken a while, but the GDIPlusX library is finally converted to be PRG based and has been upgraded from Alpha to Beta status. The new 1.00b version can be downloaded from here. But you should always check the GDIPlusX home page for the latest version.
There were several advantages to converting the library as I described in a message on the VFPX discussion board. The library is faster, smaller and more stable than before.
Special thanks to Cesar Chalom. Most all of the bug fixes and new features were added by him over the past couple of months while I converted the library.
We will hopefully update the project again from Beta to Production status by next month. We welcome any feedback. If you have any issues with the library, make sure you post them in the Issue Tracker so they can be prioritized and voted on.
For my next Blog entry I will discuss a little project Craig Boyd and I started on that will allow any VFP object (with a Picture property) to become a canvas object and have an associated Graphics object. There is a small sample posted on VPFX that demos this new functionality.
Thursday, August 16, 2007 3:32:21 AM (Eastern Daylight Time, UTC-04:00)

Sunday, June 17, 2007
Insert Images into an RTF control using GDIPlusX
The RichText control that ships with VFP is very useful for providing a formatted text edit box. While this control does support the displaying of images, there is nothing built in to the control that allows you to insert an image. I have included a function below that will allow you insert an image into the RichText control at the current cursor position.
Just specify the object reference to the RTF control and the fullpath of the image you want to insert. The image can be in any format supported by the GDIPlus library (BMP, JPEG, GIF, TIFF, EMF, PNG, etc...). You can also optionally specify the Width and Height you would like the image to be rendered.
This function requires the GDIPlusX library which can be downloaded from the VFPX project site: http://www.codeplex.com/VFPX/Wiki/View.aspx?title=GDIPlusX.
***********************************************************
* Function: InsertRTFImage
*
* Inserts an image into an RTF control at the current cusor position
*
* Parameters:
* toRTF - specifies an object reference to the RTF control
* tcImage - secifies the image to insert into the RTF
* tnWidth - Optional - Specifies the width to use for the image
* tnHeight - Optional - Specifies the height to use for the image
***********************************************************
FUNCTION InsertRTFImage(toRTF, tcImage, tnWidth, tnHeight)
LOCAL lcRTF, lcPict, lqData
LOCAL loImg AS xfcImage
LOCAL loGfx AS xfcGraphics
LOCAL loEMF AS xfcMetaFile
LOCAL lhDC, lhEMF, lnWMFLen
DECLARE Long GetDC IN WIN32API Long
DECLARE Long ReleaseDC IN WIN32API Long, Long
DECLARE Long DeleteEnhMetaFile IN WIN32API Long
DECLARE Long GdipEmfToWmfBits IN GDIPLUS.DLL ;
Long hemf, Long cbData16, String @pData16, ;
Integer iMapMode, Integer eFlags
** Make sure we have initialized the GDIPlusX library
** http://www.codeplex.com/VFPX/Wiki/View.aspx?title=GDIPlusX
IF VARTYPE(_SCREEN.System) <> "O"
ADDPROPERTY(_SCREEN,"System",NEWOBJECT("xfcSystem",LOCFILE("system.vcx")))
ENDIF
lcPict = ""
WITH _SCREEN.System.Drawing
loImg = .Image.FromFile(tcImage)
IF loImg.GetLastStatus() <> 0
ERROR "Could not open file: "+tcImage
ELSE
** If we didn't specify a width, use the image's width and height
IF EMPTY(tnWidth)
tnWidth = loImg.Width
tnHeight = loImg.Height
ENDIF
** Get the default screen HDC as a reference
lhDC = GetDC(0)
** Create a new metafile
loEMF = .Imaging.MetaFile.New(lhDC, ;
.Rectangle.New(0,0,tnWidth,tnHeight), ;
.Imaging.MetafileFrameUnit.Pixel, ;
.Imaging.MetafileType.Emf)
** We are done with the HDC reference, release it
ReleaseDC(lhDC, 0)
** Get a graphics context for the metafile so we can draw to it
loGfx = .Graphics.FromImage(loEMF)
loGFX.SmoothingMode = .Drawing2D.SmoothingMode.HighQuality
loGFX.InterpolationMode = .Drawing2D.InterpolationMode.HighQualityBicubic
** Draw the image
loGfx.DrawImage(loImg, 0, 0, tnWidth, tnHeight)
loGfx = NULL
** Convert the Metafile to a "Windows Metafile".
** This is the best format for the RTF control.
lhEMF = loEMF.GetHenhmetafile()
lnWMFLen = GdipEmfToWmfBits(lhEMF, 0, NULL, 2, 0)
lqData = REPLICATE(0h00,lnWMFLen)
GdipEmfToWmfBits(lhEMF, lnWMFLen, @lqData, 2, 0)
DeleteEnhMetaFile(lhemf)
loImg = NULL
** This is the RTF tags for the image
lcPict = [{\pict\wmetafile8]+;
[\picwgoal]+ALLTRIM(STR(tnWidth*15))+;
[\pichgoal]+ALLTRIM(STR(tnHeight*15))+;
CHR(13)+CHR(10)+;
STRCONV(lqData, 15)+;
CHR(13)+CHR(10)+[}]
ENDIF
ENDWITH
** Stuff the image into the RTF control
toRTF.SelRTF = [{\rtf1\ansi\ansicpg1252\deff0\deflang1033\uc1 ]+lcPict+[}]
RETURN
ENDFUNC
You can also download a sample program using this function here: RTFInsertImage.zip (2.19 KB)


Bo Durban
Keywords: RichText RTF FoxPro VFP GDIPlus GDIPlusX Image
Sunday, June 17, 2007 10:11:49 PM (Eastern Daylight Time, UTC-04:00)
VFP Development

Wednesday, June 13, 2007
HTML Tables and Styles
Have you ever tried to add borders to individual cells in an HTML table using style sheets? Something similar to <table border="1"> only done with CSS.
I had a requirement to put a 1 pixel black border between all cells in an HTML table. I wanted to do this without having to put a style or class attribute into every cell in the table. I thought: "How hard can this be?". There has to be a way of doing this with a single style attribute.
But after a quick search on the web with too many non-relevant results, (I mean what can you search for that doesn't bring back over a million hits). I decided to come up with my own technique:
<style type="text/css">
table.border tr td,
table.border tr th {border:1px solid black;}
table.border {border-collapse:collapse;}
</style>
<table class="border">
<tr>
<th>Header 1</th>
<th>Header 2</th>
<th>Header 3</th>
<th>Header 4</th>
</tr>
<tr>
<td>Data 1</td>
<td>Data 2</td>
<td>Data 3</td>
<td>Data 4</td>
</tr>
<tr>
<td>Data 1</td>
<td>Data 2</td>
<td>Data 3</td>
<td>Data 4</td>
</tr>
</table>
Yields the following output:
| Header 1 |
Header 2 |
Header 3 |
Header 4 |
| Data 1 |
Data 2 |
Data 3 |
Data 4 |
| Data 1 |
Data 2 |
Data 3 |
Data 4 |
Is there a better way of doing this?
Bo Durban
Wednesday, June 13, 2007 2:13:21 PM (Eastern Daylight Time, UTC-04:00)
Web Development

Tuesday, June 12, 2007
I have entered the world of blogging
After much prodding, mostly by Craig Boyd, I have finally set up a blog. I plan to post some of my daily ramblings here under the Moxie Data banner.
I’m using the dasBlog based on Craig’s recommendation. It was fairly easy to set up and customize. So far, so good.
Tomorrow I will post something a little more technical, but for now I want to encourage anyone who has not signed up for a conference yet this year, to do so. The quality of session topics is better than ever plus there are several new speakers bringing in some fresh ideas.
I will be speaking at the FoxForward conference in Alpharetta, GA on September 7th-9th, 2007. It is super convenient for me (about 30 miles away) and only a few miles north of downtown Atlanta. Kevin Cully did a great job putting this conference together last year. His first ever. So I look "forward" to what he has in store for this year.
I will also be at the Southwest Fox conference in Mesa, AZ on October 18th-21st, 2007. I will hopefully be doing a vendor session to show off some of the new reporting enhancements in Sedna and how we are leveraging them in our Moxie Objects 2.0 product. I have attended SWFox for the past 2 years and have always had a great time. If you are going, I recommend you plan an extra day to take in the sites in and around Phoenix.
Anyway, thanks for stopping by. Check back soon. Over the next few days I will be posting some examples using the GDIPlusX library, part of the VFPX project on Codeplex. I have a long way to go to catch up to the number of great articles and blog entries potsed by Cesar Chalom.
Bo Durban
Tuesday, June 12, 2007 3:51:47 PM (Eastern Daylight Time, UTC-04:00)
General