Women in Technology

Hear us Roar



Article:
  Using the CodeDOM
Subject:   Doesn't work!
Date:   2003-02-11 11:26:35
From:   Steve Peters
This article seemed very interesting. Unfortunately, I had to spend a lot of time getting the code to work. In fact, there are SEVERAL syntax errors within the code. Rather than having a disjointed example with chunks of code all over the place, it would have been much better to get the code all in one place, such as a complete listing at the end, or a link to download it.
Full Threads Oldest First

Showing messages 1 through 3 of 3.

  • Doesn't work!
    2003-02-12 18:52:22  neh123us@yahoo.com [View]

    I am sorry that you had difficulty getting the sample code to work. In the future I will try to make it easier to get the complete source code.
    • Doesn't work!
      2004-02-12 15:58:37  dipin [View]

      Is it possible for you to make the complete source code available?
      • Doesn't work!
        2004-12-10 07:16:29  PaulHayman [View]

        Changes Required..

        1) Change the following Line in CodeVariableDeclarationStatement method :

        CodePrimitiveExpression[] cpe = new CodePrimitiveExpression[Characters.Length];

        to

        CodePrimitiveExpression[] cpe = new CodePrimitiveExpression[Characters.Length-1];

        2) Use these namespaces in your class:

        using System;
        using System.IO;
        using System.CodeDom;
        using System.Text;
        using System.CodeDom.Compiler;
        using Microsoft.CSharp;
        using Microsoft.VisualBasic;


        3) Move the CurrentNamespace variable outside the CodeComProvider so it is in scope for the GenerateCode method.

        4) In the CSharpCode property, change the return statement so that it returns GenerateCode() rather than GeneratorCode()

        I could post my working solution to an email address if you wish.

        Paul