RSS2HTML Scout

Hello, World! example for RSS2HTML Scout library and Visual C++

Products Download Purchase Support Contacts
 
RSS2HTML Scout library
Direct Links

 

 

Looking for ASP script to display RSS? Check our RSS2HTMLPro.ASP script for ASP/ASP.NET

 

Tutorial: How to convert RSS to HTML using
RSS2HTML Scout ActiveX library and Visual C+

 

You can download the source code of this example here: rss2htmlscout_vc.zip

This page will teach you how to use Visual C++ and RSS2HTML Scout ActiveX library to convert RSS into HTML in your VC application.

RSS2HTML Scout is capable of downloading RSS feeds using built-in multi-threaded and converting RSS into HTML code using HTML templates (check online documentation for more information about templates)

Download and install the latest version of RSS2HTML Scout. You can download it here

1) Run Visual C++

2) Select the "New.." command from "File" menu (as it is shown below) to run  :
File menu in VC IDE
 
3) New Project Wizard dialog will appear on the screen. Select "Win32 Console Application" project type and enter "HelloWorld" as the Project name as shown on the screenshot below:
 
VC new project wizard
Set new project name and click OK
 
4) The wizard will ask what kind of Console Application you want to create. Select  A "Hello, World!" application and click Finish:
 
Select new project type
 
VC++ will show summary information for the new project. Click OK:
 
New project summary
 
Visual C++ will generate application code for a simple console application
 
The source code editor window will appear. To edit main() function just open the class tree on the left and double click on "H elloWorld Classes" | "Globals" | "main (int argc, char* argv[1])":
 
Main function in code editor
 
VC++ will open main() function: 
 
Code editor window
 
5) To use RSS2HTML Scout ActiveX in  VC++ application you have to tell the compiler to import type library information into the project.
 
To import type library just add #import compiler directive after #include directive:
 
#import "RSS2HTMLScout.tlb"
using namespace RSS2HTMLScoutLib;
 
6) The code snippet below will convert RSS to HTML using RSS2HTML Scout ActiveX library
 
#include "stdafx.h"

#import "RSS2HTMLScout.tlb"
using namespace RSS2HTMLScoutLib;

int main(int argc, char* argv[])
{
       // initialize OLE
       HRESULT hr = CoInitialize(NULL);

       // check for errors
       if (FAILED(hr)) {
       MessageBox(0,"OLE initialization errp","error",MB_OK);
       return -1;
       }
       // declare SWFScout object
       IRSS2HTMLScout* RSS2HTML = NULL;
       CLSID clsid;

       // get inuque ID for IFlashMovie interface
       hr = CLSIDFromProgID(OLESTR("RSS2HTMLScoutLib.RSS2HTMLScout"), &clsid);
       // check for errors
       if (FAILED(hr)) {
       MessageBox(0,"Can't get CLSID for interface","error",MB_OK);
       goto Uninit;
       };
       // create FlashMovie object
       hr = CoCreateInstance(clsid, NULL, CLSCTX_ALL,__uuidof(IRSS2HTMLScout), (LPVOID*)&RSS2HTML);
       // check for errors
       if (FAILED(hr)) {
       MessageBox(0,"Can't create RSS2HTMLScout object","error",MB_OK);
       goto Uninit;
       }

       RSS2HTML->ItemsPerFeed = 5; // display only 5 latest items

       // ##### we can add more than one RSS feed #########
       RSS2HTML->AddFeed("http://bytescout.com/news.xml", 180); //  update every 180 minutes (3 hours)

       RSS2HTML->Execute();

       RSS2HTML->SaveOutputToFile ("RSS2HTMLOutput.html");// save output to HTML file

       // disconnect from library
       RSS2HTML->Release();
       // uninitialize OLE libraries
       Uninit:
       CoUninitialize();
       return 0;
}
 
Hint: 
 
you can simply copy and paste the code from the sample above into VC++ code editor window.
  
7) Run the application by pressing F5 (or use  "Build" | "Debug" | "Go")
VC++ will compile and run "Hello, World!" application. It will generate HTML code and then will save it into RSS2HTMLOutput.html file.
 
You can view generated HTML file using Internet Explorer or another browser. To display HTML files in your Visual C++ application please use WebBrowser control
 

HTML content converted from RSS using RSS2HTML Scout ActiveX library

 
You can download the source code of this example here: rss2htmlscout_vc.zip

See also:




"Hello, World!" examples for different programming languages will guide you step by step from the very beginning:

See also:

PRODUCTS  |  DOWNLOAD  |  PURCHASE  |  SUPPORT  |  CONTACTS  |  TESTIMONIALS  |  NEWS
Copyright © ByteScout, 2003-2009. Privacy Statement
Microsoft®, Windows®, Windows 2000®, Windows Server®, Windows Vista®, Internet Explorer®, .NET Framework®, ActiveX®, Visual Basic®, Visual C#®, ASP®, ASP.NET®, Excel®, PowerPoint®, are either registered trademarks or trademarks of Microsoft Corporation in the United States and/or other countries. Adobe®, Flash® and Acrobat® are registered trademarks of Adobe Systems, Incorporated. Mozilla®, Firefox® and the Mozilla and Firefox Logos are registered trademarks of the Mozilla Foundation. Other product names or brandnames used herein are for identification purposes only and might be trademarks or registered trademarks of their respective companies. We disclaim any and all rights to those marks.