3
голосов
2ответов
1532 просмотров

Absolute COM Confusion - C# interop with early-binding

I've been battling with VStudio, Google and various other tools and websites all day and found no solution - HELP!! I have two COM interfaces (pure COM, no ATL): IMyClassFactory and IMyClass with corresponding implementations I want to use them from C# BUT without registering the COM server wi...

2
голосов
3ответов
5078 просмотров

Cannot instanciate .Net COM object in classic ASP/VBScript page (Error ASP 0177)

I've written a COM interop enabled class-library in C# using .Net 3.5. The object is meant to provide some utility functions for classic ASP pages. I've written a test.asp page which instanciates the desired object and calls its methods. Works fine on my machine. On a different machine (Windows ...

1
голосов
1ответов
1621 просмотров

How to create propput IDL method .NET interface for COM usage

I am having an issue using a .NET/ComVisible assembly in Excel/VBA. I defined several parameters as "object" in .NET so they will be translated to Variant in VBA since optional parameters in VBA need to use Variant types. The problem is when I try to use the object in Excel/VBA, I get a "Run-tim...

3
голосов
2ответов
653 просмотров

Sever a .NET COM Interop assembly from its hosting process

When an ActiveXObject is hosted in a Windows Desktop/Sidebar Gadget, that ActiveXObject is sort of cached and the DLL file for it is locked (meaning it cannot be moved, deleted or renamed). The problem is this; when the gadget is subsequently closed, the DLL is still locked by Windows Sidebar an...

0
голосов
1ответов
485 просмотров

Failure to use AppDomain from COM interop

I've a piece of .NET code that for various reasons (reliability, deployment) must run in a separate AppDomain. I've created a proxy object deriving from MBR that delegates the calls to the real stuff so it wont load in the current AppDomain. I create the proxy via the usual CreateInstanceAndUnwra...

0
голосов
2ответов
98 просмотров

Is it possible to prohibit putting my in-proc component into COM+?

I have an ATL C++ in-proc COM component. This component is not for external use - I only need it for use in our application. Once in a while users put it into COM+ and this leads to all sorts of weird errors - "Access denied", etc which I'd like to just never hear about. The best way would be to...

2
голосов
1ответов
1826 просмотров

List columns in a SSIS Flat File Connection

I'm trying to produce a column 'start/length' spec document from a SSIS package that exports a DB table to a flat file. I have hit something of a brick wall in getting the Columns property from the ConnectionManager object that handles the flat file connection. I am able to get the Columns prop...

2
голосов
1ответов
3551 просмотров

Need of ClassInterfaceType.None?

Didn't quite get the following from MSDN: ClassInterfaceType.None Indicates that no class interface is generated for the class. If no interfaces are implemented explicitly, the class can only provide late-bound access through the IDispatch interface. This is the recommended ...

27
голосов
4ответов
16550 просмотров

How to get type of COM object

I am referencing a COM library in Visual Studio, so it has automatically created the corresponding Interop assembly for me. I would like to do a GetType() on these com objects, but they always return System.__ComObject. Querying them for an interface works though: bool isOfType = someComeObject ...

9
голосов
1ответов
7167 просмотров

When return E_POINTER and when E_INVALIDARG?

COM interfaces methods can return various HRESULT values to signal invalid argument values passed. When do I return E_POINTER and when E_INVALIDARG? As I understand if a method receives an index in an encapsulated collection and it is out of bounds that is E_INVALIDARG. If a method receives an I...

1
голосов
3ответов
837 просмотров

Is it worth checking for null pointer in QueryInterface() implementation?

IUnknown::QueryInterface() is passed a void** parameter denoting an address where to put the retrieved interface. STDMETHOD QueryInterface(/* [in] */ REFIID riid, /* [iid_is][out] */ void** ppvObject) Should the implementation of QueryInterface() check this pointer for being null (and then imm...

1
голосов
3ответов
4226 просмотров

log4net - logging for a dll called via COM interop

I've written a .NET DLL which is called from another application using COM interop. I'd like to use log4net, but I need to specify the location of the log file at runtime from the other application. I've always used log4net in the simplest possible way for WinForms project, but since a DLL proj...

18
голосов
1ответов
2120 просмотров

How can I invoke a static method on a .NET object over COM interop?

Is it possible to invoke a static method on a .NET Object, via COM interop? I know I could write a wrapper class. What if I don't wanna do that?

1
голосов
2ответов
1099 просмотров

Automatically strong naming COM Interop wrappers

I have a C# project in Visual Studio 2005 that is referencing a few COM libraries. When I build it errors like this are thrown: Referenced assembly 'assemblyName' does not have a strong name. Now, I used to reference COM assemblies in Visual Studio 2003, and it would automatically sign the ...

5
голосов
2ответов
1860 просмотров

How to properly clean up interop objects in C#

This is a follow on question to How to properly clean up excel interop objects in c#. The gyst is that using a chaining calls together (eg. ExcelObject.Foo.Bar() ) within the Excel namespace prevents garbage collection for COM objects. Instead, one should explicitly create a reference to each C...

6
голосов
1ответов
3262 просмотров

COM Interop (how to pass an array to the com) via classic ASP

I need to create a com object for my classic asp, since i can create a .net Assembly and have it 'Interop' with com, so i proceeded to create a .net Assembly like this:- using System; using System.Collections.Generic; using System.Runtime.InteropServices; using System.Linq; using System.Text; us...

1
голосов
1ответов
1260 просмотров

How do I dispose of a VB6 COM object i'm using via an interop assembly from IronPython?

I'm using a third party COM component by means of a .NET interop assembly in IronPython, as seen here: How can I use a VB6 COM 'reference' in IronPython? My experience in this area has been great, I'm very impressed by the amount of stuff that works seamlessly... except one thing. The 3rd party...

18
голосов
5ответов
8545 просмотров

COM Interop without regasm

I'm a limited user, and I need to write an Outlook macro that exposes a C# library in Outlook 2003 and 2007. I do not have any admin privilges at all, not even at install time, so I can't run RegAsm and I can't (I assume) write a managed add-in. Is there any way to call .Net code from VBA in ...

0
голосов
1ответов
178 просмотров

Cross User COM Interop

I am using a third party database. A host application runs the database, and allows client applications to connect to the server app over COM. I am running Windows 2003 Server, and writing all of my code in C#. On the server, I login as UserA, and am able to launch the host application locally, ...

3
голосов
3ответов
1485 просмотров

Inspecting an instance of a COM / Interop class properly in VS.Net's debugger?

Does anyone know if and how it's possible to see COM / Interop objects properly (in their correct type) in VisualStudio's debugger? All I get is the 'evil' System.__ComObject value (even though it correctly identifies the type)? E.g.:

8
голосов
3ответов
1244 просмотров

Java SWT interop with COM - putting a float[] into a Variant?

In my Java SWT application I'm hosting an 3rd party ActiveX control. I'm using OleClientSite to do this. // Ah, this works. :-) OleAutomation comObject = new OleAutomation(...); There are 2 easy little functions I want to call from Java. Here are the COM function definitions: [id(5)] void eas...

0
голосов
1ответов
73 просмотров

How to determine if an event is complete using a 3rd Party API - C#?

I am currently working with a third party ActiveX control where I need to detect when an event I called from the API has completed. Looking at the ActiveX control in VS 2008 Object browser, I call public virtual bool MyMethod() and there is an event public virtual event IActiveXObject_MyMethodEv...

1
голосов
4ответов
3024 просмотров

Marshalling CodeElements to an IntPtr in C#

I am writing a Visual Studio add in and need to marshall a managed CodeElements object to it's unmananged form. I just need the pointer in memory, as I can cast it and treat it like a CodeElement on the unmanaged side. [DllImport("CodeMethodsToString.dll")] private static extern BSTR* C...

4
голосов
2ответов
2034 просмотров

How To Expose a DIctionary<> to COM Interop

I have an Interface that is defined something along these lines: Interface foo { int someProperty {get; set;} Dictionary<string, object> Items; } The concrete class that implements this interface needs to be registered for COM Interop. Everything compiles and the assemblies seem ...

4
голосов
4ответов
2933 просмотров

How to debug vs 2008 c# express dll which is called by a vb6/vba app?

i have a c# dll which is written to act as a wrapper to grab data from a data source and pass it to a vba/powerpoint ppa application. i don't have much experience with vba which is why i'm simulating this using vb6 which i know a tiny bit more about. i'm having enough problem as of now trying t...

0
голосов
2ответов
859 просмотров

Invoke a javascript function with VB.net through COM Interop

I have a VB.net class registered for COM interop which I'm instantiating within an HTML page using the following code: <script type="text/javascript"> var MyClass = new ActiveXObject("Namespace.TestClass"); </script> I can call methods on it just fine, but suppose I want to set a j...

0
голосов
1ответов
1524 просмотров

using classes inside a COM exe from .Net

I have a .exe file I've been given which has COM classes inside it -- these are from C++, not .net ComVisible types I'd like to use those classes inside my .net project, but I can't add a reference to the exe; when I try I get DIALOG BOX: --------------------------- Microsoft Visual Studio -...

0
голосов
4ответов
155 просмотров

Why is there interface / class (IFoo, FooClass) pattern in Office Interop API?

In the Microsoft.Office.Interop.Visio library each entity (for e.g Shape), is described as a class (ShapeClass) and an interface, Shape. So for each element you have: interface Shape { ... } class ShapeClass : Shape { ... } interface Page { ... } class PageClass : Page { ... } ... Why is it...

7
голосов
3ответов
4454 просмотров

Force .NET interop to use local COM DLL

Is it possible to force an interop assembly to reference a local copy of its associated COM DLL? Here's the scenario: I have a .NET app that references an interop assembly (Interop.OTAClient.dll), which is the interop for a COM DLL (OTAClient.dll, which is the automation API for HP Quality Cent...

0
голосов
2ответов
403 просмотров

Hosting a .net assembly for COM interop with long lifetime?

I have a component (an assembly built in .net) that i need to access on (almost) every request to two different websites. One website is written in classic asp and the other one in asp.net mvc. At the moment i reference the assembly in the asp.net solution and call it like i would any .net assem...