S
stunt016
I have a program written in C# that handles communication between two
pieces of software. My problem only deals with getting a text array
from one program to this C# "Bridge". I can get the text array to the
bridge, where it is received as a system.object. My problem is casting
this system.object to a string array. The code I'm using is below.
System.Array advArgs = args as System.Array; //creates array for
parameters being received
object advCommands = advArgs.GetValue(2); //gets the 3rd parameter
which is the array from the external software, stores it in
advCommands.
GCListOrArray GCarray = new GCListOrArray(); //GCarray is new
GCListOrArray interface, this interface was written by the external
software develpoer for applications like this.
GCarray = (GCListOrArray)advCommands; //Convert advCommands to
GCListOrArray interface type
Basically, when I try to WriteLine, the compiler says that it cannot
cast System.__ComObject. I have tried everyway I know of casting it,
but had no luck. Any suggestions?
Thanks in advance.
Tyler
pieces of software. My problem only deals with getting a text array
from one program to this C# "Bridge". I can get the text array to the
bridge, where it is received as a system.object. My problem is casting
this system.object to a string array. The code I'm using is below.
System.Array advArgs = args as System.Array; //creates array for
parameters being received
object advCommands = advArgs.GetValue(2); //gets the 3rd parameter
which is the array from the external software, stores it in
advCommands.
GCListOrArray GCarray = new GCListOrArray(); //GCarray is new
GCListOrArray interface, this interface was written by the external
software develpoer for applications like this.
GCarray = (GCListOrArray)advCommands; //Convert advCommands to
GCListOrArray interface type
Basically, when I try to WriteLine, the compiler says that it cannot
cast System.__ComObject. I have tried everyway I know of casting it,
but had no luck. Any suggestions?
Thanks in advance.
Tyler