I'm in a position where I have to work with a 3rd party vendor's COM object in a custom app. I have a small bit of sample code below in VB.NET to instantiate and begin working with the object in question. The thing is, I've never worked with COM before and all my other code around this project is in C# and I'd like to keep it that way if possible:
The bold line in the above code (AccuCass = CreateObject("CASS")) is where the COM object is instantiated with a VB.NET CreateObject method. There does not appear to be a corresponding C# method. How would I go about the same process in C#? Feel free to let me know if you need more info or code.Code:Console.WriteLine("Initializing Variables") Console.ReadLine() Dim AccuCass As Object Dim inputAddress, outputAddress As String Dim inputFirmName, outputFirmName As String Dim inputCity, outputCity As String Dim inputState, outputState As String Dim inputZip, outputZip As String Dim accuzipConfig As String Dim returnCode As String = "" Console.WriteLine("Variables Done") Console.ReadLine() Console.WriteLine("Initializing COM Object") Console.ReadLine() AccuCass = CreateObject("CASS") Console.WriteLine("COM Initialized") Console.ReadLine()
Thanks,
Steve




Reply With Quote