Problem with OPC OPCGroups in C#

S

Thread Starter

Stephane

An unhandled exception of type 'System.InvalidCastException' occurred in application

Additional information: QueryInterface for interface OPCAutomation.IOPCGroups failed.

I have already looked at all messages concerning this problem in the forum. It seems to be an opc bug but I am not a member of the opc foundation in order to download the new API.

I want to modify the wrapper (the only solution ?)
Can someone help me for this modification?
 
Stephane,
Chapter 7 of Nathan's book on .NET and COM Interoperability
describes the process of disassembling to IL, modifying, and reassembling,
to address these types of problems.

But this is not the only solution. Here are some other ideas:
* Ask you server vendor for a fixed version of the automation
wrapper.
* Import the custom interface(s) as an ActiveX.
* Write your own interface wrapper in C# to the custom interface.
* Or... try our OPC 'tag server' component that does all of the communications for you. You won't have to know anything about interfacing to
OPC, just basic VB.NET or C#. Use events or polled data, configure with the included UI or your own. Also works in a service. It just takes a few minutes to try it. There are several sample projects in VB.NET and C#.

http://IndustrialDotNet.com/Downloads/LIO0103.zip

Good luck!
[email protected]
 
seems you are having some kind of dll hell problem there.

Have you installed a handfull of opcservers lately? First, Try in another computer to see if it has the same problem. Second, Try unregistering all that dll and reinstalling just the one you need.
 
Top