07-13-2012 04:06 PM
Hi All,
I have a .NET class that wraps the Internet Explorer API. All of my methods are working except one. I have one method that crashes with the exception:
Specified cast is not valid.
Source: mscorlib at System.RuntimeType.ForwardCallToInvokeMember(String memberName, BindingFlags flags, Object target, Int32[] aWrapperTypes, MessageData& msgData)
at mshtml.HTMLDocumentClass.get_frames()
at IEAutomation.IEWrapper.GetPTCStatusValueCell(String statusName)
at IEAutomation.IEWrapper.GetPTCStatusValue(String statusName)
Here's the kicker though, if I call this same method from another app on the same machine for the same webpage using the same values there are no errors.
Anyone have ideas?
07-16-2012 12:46 PM
Forsetti,
I have a few questions that will help me address your issue:
07-16-2012 01:55 PM - edited 07-16-2012 01:56 PM
.
07-16-2012 02:02 PM
Thank you for replying.
I was able to (just a few minutes ago) determine the issue. I honestly do not fully understand it but the problem is in the call to the COM method. To resolve the issue I make the call on a separate thread and it works fine. I believe it has something to do with the security surrounding frames but why the call worked from other applications I am not sure.