OK, I've done it! Attached is a VS2005 solution which consists of a wrapper .NET class library for the Plan Compiler, as well as a little C# test program that shows how to use it. You'll see how simple it isi to compile a plan and get back everything as objects, collections, etc. I was just amazed how easy it was to use the compiler WSC from VB.NET (that's what the wrapper class library DLL was written in).
For starters, load up the AcpPlan solution and look around. Check out the tester application (command line). It's already set to just run in the VS IDE when you click the run button (I included a test plan and set the debugging options to have it on the command line and set the current directory). Note the sleazy trick I discovered for making the fake Util.Console! I am totally amazed it worked.
To use this from any app in any .NET language:By looking at how the Tester app uses the Plan Compiler, you should be able to figure out most of the rest. NOTE: There are probably some bugs in the wrapper properties/methods; that's one of the reasons I sent you the whole solution/sources.
- You must have the ACP Plan Compiler WSC installed. I hereby give you permission to distribute it with Planalyzer, no strings attached. Put it in ProgFiles\ACP ObsControl and right-click/register it. You can register it via an installer (Inno or MSI).
- Put the AcpPlan.dll file anywhere on your development system.
- Add a reference to AcpPlan.dll (references/browse) to your app
- Add using DC3.ACP; to the source file where you want to use the compiler
- Implement the fake Util.Console in your app. Look at how it's done in the Tester app.
Feel free to ask me questions by email. If you find bug(s) and correct them, I'd like to get the corrected sources bgack for future use.