|
-
Oct 26th, 2007, 10:06 AM
#1
Thread Starter
Addicted Member
[RESOLVED] [2.0] Working with a COM Object in C#
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:
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()
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.
Thanks,
Steve
-
Oct 30th, 2007, 07:56 AM
#2
Re: [2.0] Working with a COM Object in C#
-
Oct 30th, 2007, 08:54 AM
#3
Thread Starter
Addicted Member
Re: [RESOLVED] [2.0] Working with a COM Object in C#
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|