Chilkat RSS reader using ActiveX
DataFlex is an easy to use framework for building database applications, in this post I describe how you can use an ActiveX component and add that into the studio. So that you can use it in your applications.
For more details watch my video where I show the process "Discovering DataFlex 27 Chilkat RSS reader using ActiveX".
In this sample we user the RSS feature of the ChilKat library. But the same applies for any ActiveX component you want to use out there. We start by downloading the ActiveX component in a 32-bit version from https://www.chilkatsoft.com/downloads_ActiveX.asp. In this case it comes with an MSI Installer and we use that to install the component.
When that is installed we head over to the DataFlex Studio and create a new workspace. Then we create a web project, but it works just as well as a Windows project.
In the projec we create a simple view with a button that calls a function to fetch the data and an HTML-box to display the result.
ChilKat is providing fully functional samples and we want to use the RSS sample.
In order to use the ChilKat RSS plugin we need to create classes that use it. We do this by adding a Class and selecting the "Import COM ActiveX" option. Then we pick ChilKat from the list and select the features we want to include.
Now DataFlex generates the class for you and you can "Use" it in your code.
In this case we want to get data both from the tag content and a tag attribute in the rss xml. The xml looks as follows and the code to extract the data you can see below.
Get ComGetString of hoRssItem "pubDate" to sPubDate Move (sRssString + "pubDate: " + sPubDate + sCr) to sRssString Get ComGetAttr of hoRssItem "media:content" "url" to sImagePath Move (sRssString + "image: " + sImagePath + sCr) to sRssString
- DataFlex, ChilKat, RSS, ActiveX