Carl Barnes' adaptation of the OleCtl class for C6

From Carl Barnes:

Attached is OleTCL class adapted to run under C6 threading. The original created a separate thread with its own window to host an OLE control. The class ran code in that thread using SetTarget() which is not recommended for C6 and later.I included a test project that runs the original scripting and XLS code.

My changes were to put the OLE control on the currently open window, and get rid of the entire separate thread and window. This does require you to have a window open, Jim's original class did not. Really very simple changes. I wanted to preserve all the function calls in my existing code. It had a status window open, which I would guess most code does.

In my tests it runs my code that uses the Microsoft.XMLDOM perfectly to read an XML file and write a CSV file. I compared CSV output so I know it is 100% the same output. There are 70+ lines of code calling OleTcl methods.

To use it put the oletcl6.clw and 6.inc files in your directory. You can either change your APPs that Include('oletcl.inc') to 'oletcl6.inc', or simply rename the oletcl6 disk files without the "6" so they get used instead.

DiscussOleTcl.zip

The original article is Clarion COM: As Easy As Visual Basic COM http://archive.clarionmag.com/cmag/v2/v2n5easycom.html