none
.net reflector and c# RRS feed

  • Question

  • I have this class in C# which brings an exception.

    I have used a  .net reflector and this is how the reflector showing after adding the library.

    Here is the reflector code.Where am i going wrong with writing the program.

    namespace FiscPrnSys
    {
        [ComImport, Guid("69FBCAF8-C7EA-4241-87A8-16AA662EA25D"), CoClass(typeof(FiscPrnIfaceClass))]
        public interface FiscPrnIface : IFiscPrnIface
    
        [ComImport, Guid("741F1E1B-0D59-4F59-A775-3E1B13721638"), ClassInterface((short) 0), TypeLibType((short) 2)]
        public class FiscPrnIfaceClass : IFiscPrnIface, FiscPrnIface
    
        [ComImport, InterfaceType((short) 2), TypeLibType((short) 0x1000), Guid("69FBCAF8-C7EA-4241-87A8-16AA662EA25D")]
        public interface IFiscPrnIface
    }

     using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Runtime.InteropServices;
    using FiscPrinter = FiscPrnSys.FiscPrnIface;




    namespace IncortexLibrary
    {


    public class Class1
    {

    //public class FiscPrnIfaceClass : IFiscPrnIface, FiscPrnIface




    public List<String> salesITems = new List<String>();
    public String user;
    public String shop;
    public double total;
    public double subtotal;
    public String tax;
    public short data = (short) 8;
    public short parity = (short)0;
    public short stopbit = (short)1;


    public void PrintBon()
    {

    FiscPrnSys.FiscPrnIface FiscPrinter = new FiscPrnSys.FiscPrnIface();
    FiscPrinter.Connect("COM2", 9600, data, parity, stopbit);
    FiscPrinter.TestPrinter((short)48, "1,0,1", "HELLO");
    FiscPrinter.Sale("TEST ITEM 1", "A", 2, 2, 0);
    FiscPrinter.Sale("TEST ITEM 1", "A", 2, 2, 0);
    FiscPrinter.Sale("TEST STOCK ITEMS ZERO VAT", "B", 2, 2, 0);
    FiscPrinter.Sale("Cooking Fat Always Ultra", "B", 2, 2, 0);
    FiscPrinter.PrintFiscalText("TEST STOCK ITEMS VATABLE");
    FiscPrinter.Sale("001000124", "A", 2, 2, 0);
    FiscPrinter.PrintFiscalText("Kimbo 1 Kg");
    FiscPrinter.Sale("598699484", "A", 5, 5, 0);
    FiscPrinter.PrintFiscalText("Tily Cooking Fat");
    FiscPrinter.Sale("484949404", "A", 2, 2, 0);
    FiscPrinter.Sale("Always ULtra", "A", 10, 2, 0);
    FiscPrinter.Disconnect();

    }

    public void setUser(String user)
    {
    // this.user = user;
    }

    public void setShop(String shop)
    {
    this.shop = shop;
    }

    public void addSaleItem(String item)
    {
    salesITems.Add(item);

    }

    public void setDouble(double pTotal)
    {
    // this.total = pTotal;
    }

    public void setSubTotal(double sTotal)
    {
    this.subtotal = sTotal;
    }

    public void setTax(String pTax)
    {
    this.tax = pTax;
    }



    }
    }

            

    Monday, July 23, 2012 7:45 AM

Answers