Hi,
Below the statement conversion is wrong in your code.
(int)XdDocumentVersionMode.xdCanOpenInReadOnlyMode);
Instead of above statement you can use the below one:
XdDocumentVersionMode versionMode =
XdDocumentVersionMode.xdCanOpenInReadOnlyMode);
Hope this helps you.

Signature
Shiva
http://www.ggktech.com
> Hi,
>
[quoted text clipped - 22 lines]
>
> Eric.
educos - 07 Sep 2007 15:04 GMT
Hi Shiva,
I am surprise of ths point..why this problem of conversion could explain the
"invalid cast exception" on the Errors property.
I changed my code like this...and have always the same problem:
ApplicationClass app = new ApplicationClass();
XdDocumentVersionMode mode = XdDocumentVersionMode.xdCanOpenInReadOnlyMode;
int numMode = (int)mode; // =8
XDocument form = app.XDocuments.Open(@"MyForm1.xml", numMode);
ErrorsCollection ec = form.Errors; // ==> 'Invalid cast exception'
int countErrors = ec.Count;
app.Quit(false);
Any other idea ?
Regards.
Eric.

Signature
Cordialement.
Eric.
> Hi,
> Below the statement conversion is wrong in your code.
[quoted text clipped - 34 lines]
> >
> > Eric.