November 20
Using ActiveX Controls in VFP
by Claudio Lassala
Sometimes we do need to add some functionality to our applications that VFP doesn't have natively. A common way to address this issue is by the using of ActiveX Controls. In this session, Marcia Akins presented some gotchas about the using of some of those controls from within VFP.
The first thing she showed was how we can investigate PEMs of ActiveX Controls. Once again the Object Browser tool comes handy. By using it, we can locate the OCX and help files of the ActiveX control, and then investigate its PEMs, constants and Enums.
Another good way for investigating of
those controls is by the using of the ActiveX property sheet (called by right-clicking
on the control and choosing Properties…). That pops-up a dialog where we can
set several properties of the control.
The first ActiveX control showed by Marcia was the ImageList Control. The reason for that is because Treeviews and Listviews controls uses images, but they cannot host images by themselves. Here the ImageList enters the picture. It stores images loaded on it that it's going to be used by other ActiveX controls.
We can load images in a Listview both in design time and in Runtime. In design time, we can use the property sheet of the control. One gotcha is that we must set the image size first, and just after that we must add the images. The reason for that is that after any image has been loaded, we cannot change the size of the images. That could be a pain if after has added several pictures we need to change its size; we would need to remove all images, change the size, and then add then again!
The next step is binding the ImageList control to the Treeview control. This MUST be done in runtime (the option to set this up in runtime does exist, but it does not work). In order to do the binding in runtime is just a matter of running the following code (sort of…): Thisform.oTreeview.ImageList = Thisform.oImageList.Object
Next, we need to add nodes to the treeview. That can be accomplished by the using of the Add() method of the Nodes collection (which is a member of the Treeview control).
Marcia showed her nice Treeview class that handles related tables in order to show their specified data. That's very cool.
Following that, Marcia showed how we can make use of the Listview control. One of the main things we usually do with this control is simulate a better "grid", using some images on it. Marcia said that with VFP 8 we may not be using Listviews like that very often. But, another cool thing with this approach is that we can set orders in columns without the needing of indexes (which has some overhead).
Then she showed how we can synchronize the Treeview and the Listview controls, and gets the same look and feel of the Windows Explorer. One benefit of doing this is that we don't need to teach the users to use that, because they must already be comfortable with that.
The third ActiveX Control showed was the ImageCombo control. This control can show images on each of its items, plus it shows the image of the selected item in the text part of the control. This is another thing introduced in the native combobox class of VFP 8, so we may no longer need this ActiveX control.
This session gave the attendees a very good overview and tips for using some
ActiveX controls, which are helpful for providing enhanced functionalities for
our VFP applications.
Accessing SQL Server-based Data in VFP
by Claudio Lassala
Almost every VFP developer some day faces up a situation when he need to access SQL Server-based data. In this session, Dan LeClair (from EPS Software), has presented some ways of how the developer can accomplish this.
Dan showed essentially four options: Remote
views, SQL-Pass Through and ADO.
The basics behind SQL Server data manipulation is: Establish a connection with the backend, query data, change data, post changes and close the connection.
Remote view is a native option in VFP. Among its pros Dan mentioned the convenience and the fact that the ODBC driver handles differences in data types. As for the cons, Dan mentioned the needing of a DBC and the fact that it cannot call SQL stored procedures.
Another native option is the SQL-Pass Through. Among its pros is the fact that it does not require a DBC and it can call stored procedures. Among the cons is the fact that it requires more work for the developer and it requires more knowledge of the back-end data structures.
ADO (that stands for ActiveX Data Objects) is composed by a couple of COM classes that we can use for data access and handling within any COM client (like VFP, VB, etc.). Among its pros, Dan mentioned that most controls in VFP will work with and transaction processing and conflict detection are built in. Among the cons are the famous DLL issues and that the native VFP grid cannot work with it.
Then the question comes up: which one is the best one? Dan's opinion is: well, it depends on your immediate needs, on the amount of refactoring and on future scalability.
Another technique showed by Dan was the XML features that came with SQL Server 2000. We can output XML right from the SQL statements, and use VFP's built-in XML functions to work with the results, or doing direct manipulation of it by using the XMLDOM.
Towards the end of the session, Dan talked about new thing on this subject
that comes with VFP 8: the new CursorAdapter class and the improvements on the
View Designer.
Closing session
by Claudio Lassala
Everyone was curious to see what Whil and his crew had prepared for the closing
session. Well, "Fox is Magic!", and that was what we get: Magic! Yes, we got
a very nice Magician's show (really very good). All the attendees really enjoyed
it. And in his final session, the magician put an empty box on the stage, and
guess what appeared later from inside the box? He, Mr. Whil Hentzen! That was
very cool.
Whil then said: "Thanks everyone for coming, and see you all next year!".
My impressions of this conference
by Claudio Lassala
This was my first big traditional VFP conference (I almost went to the last DevCon, but things didn't worked out timely). I must say that I'm REALLY happy with what I saw.
The conference was really amazing. The
content for the sessions were very good chosen, and the speakers had done a
very good job. I've been following these speakers in the last few years, by
reading their articles, messages on the UT, public domain tools, etc., and it
was really great meeting them all here, and having the chance of talking to
them.
Another thing that I really enjoyed was the fact that I met several people with whom we are always hanging out online. It was really great to meet you all, guys (and gals!)!!
I'd like to send my apologies to the speakers which I can't report their sessions
(Craig Berntson, Rick Borup, and a few others). There were a lot of sessions,
and after my reporter partner Mark had needed to go, it was pretty much impossible
for me covering all the sessions.
For those who followed this report through all the conference, I tried to do my best in reporting this conference. I know there are a lot of developers who would like to be here, but can't make that up, therefore I tried to provide you the most information I could in this tight timeframe that we have when reporting conferences. I really hope that this report had been helpful for you.
See you online!
Claudio Lassala