com-callable-wrapper

“COM object that has been separated from its underlying RCW cannot be used” with .NET 4.0

感情迁移 提交于 2020-01-01 09:28:11
问题 I've a class in my .NET 3.5 C# WinForms application which has five methods. Each method uses different sets of C++ COM interfaces. Am using Marshal.FinalReleaseCOMObject for cleaning up these COM objects. This code works fine on this .NET platform without any issues. But when I move this application to .NET 4.0, I start getting this error in one of these methods at a line where I cast a variable from ICOMInterface1 to ICOMInterface2 , i.e.: ICOMInterface1 myVar= obj as ICOMInterface2; COM

“COM object that has been separated from its underlying RCW cannot be used” with .NET 4.0

旧街凉风 提交于 2020-01-01 09:28:09
问题 I've a class in my .NET 3.5 C# WinForms application which has five methods. Each method uses different sets of C++ COM interfaces. Am using Marshal.FinalReleaseCOMObject for cleaning up these COM objects. This code works fine on this .NET platform without any issues. But when I move this application to .NET 4.0, I start getting this error in one of these methods at a line where I cast a variable from ICOMInterface1 to ICOMInterface2 , i.e.: ICOMInterface1 myVar= obj as ICOMInterface2; COM

Calling a .net library method from vba

泄露秘密 提交于 2019-11-26 09:02:13
问题 I have developed a web service in ASP.net, c#, and hosted on IIS, which is to be consumed by a vba client. Having downloaded the Office 2003 Web Services 2.01 Toolkit, I encountered a problem in successfully creating the proxy classes required (as documented by many users online), and decided to create a .net dll library instead. I have created the library, which references the web service and exposes one of its methods to a public function in c#. I now have three questions: How do I