I am working with the FAXCOMEXLib example that microsoft posted awhile back and am trying to port it to C#. I am having trouble with a call that returns a Variant type which holds a string array. “jobID = objFaxDocument.ConnectedSubmit(objFaxServer);”
The procedure returns a messagebox which shows “System.String[]”. I seem to recall from working with Delphi which also uses variants, that one property of the variant is just a string which shows what it is storing. Maybe this is what is going on here. But anyway, how can i get this string array out and convert it into something c# would understand?
Thanks
References:
http://support.microsoft.com/kb/317030 (shows how to return a variant from VB6)
http://msdn.microsoft.com/en-us/library/ms692936(v=VS.85).aspx (example for FAXCOMEXLib)
FAXCOMEXLib.FaxDocument objFaxDocument = new FAXCOMEXLib.FaxDocument();
FAXCOMEXLib.FaxServer objFaxServer = new FAXCOMEXLib.FaxServer();
object jobID;
try {
//Connect to the fax server
objFaxServer.Connect("");
// skipping some code, see MS example in URL above
jobID = objFaxDocument.ConnectedSubmit(objFaxServer);
MessageBox.Show("The Job ID is :" + jobID);
A simple cast will do the trick: