com

Create SxS manifest from managed COM assemblies

Hi, I have a C# dll that implements COM. Is there a way to configure the project to create the SxS manifest for this dll (exposing COM information) and embed it into resources. As I understand, running the mt tool as post-build step could be an option. But there are 2 problems: 1. manifest created with mt does not expose the Prog_ID 2. ...

Error crops up after weeks of running a website.

I have a website based on Vs2008, .NET 3.5SP1 C# code. One of the functions requires it to interop with a COM-based DLL that creates PDFs. About once every 3 to 4 weeks, anything COM related (e.g. generating PDFs) is completely hosed. I get the following error: Creating an instance of the COM component with CLSID {7A91D523-4...

COM class factory error

I am getting the following error on my workstation when I am trying to work with a COM object. An unhandled exception of type 'System.Runtime.InteropServices.COMException' occurred in CarteGraphInterface.exe Additional information: Retrieving the COM class factory for component with CLSID {3963F0F8-6B0C-4A65-90F4-F6016...

How do I render the scrollable regions of a canvas with IViewObject::Draw?

Hi, I've been trying to render the entire canvas in an IWebBrowser2 control to a bitmap. IViewObject::Draw seems to be the most promising approach, but I can't get it to render anything that would requires a scroll to show. While I could automate the scrolling and stitch the images together, this would look weird with any fixed positi...

Obtaining COM objects from unmanaged code

I have a library that exports an unmanaged C routine that returns pointers to COM IUnknown-based objects. The DLL is not registered, and is not server. I would like to use the COM types from C#. I have already written C# interfaces for the COM types. What is the C# equivalent of calling LoadLibrary() and GetProcAddress()? How would ...

COM port terminal program

Hi, I have developed an embedded application which requests status information from a device down a communications channel. My customer requires that these will be sent with a specific time period, so what I am looking for is a PC terminal application which can send a text string command repeatedly at a set interval over a period of ti...

Create a File in C# and pass it as an IntPtr to a COM object

I'm working with some COM objects in C#, one of them has a function called SetLogFile that takes an IntPtr. How can I create the file in C# then pass it as an IntPtr to that COM function? EDIT: The function requires an open file handle: http://msdn.microsoft.com/en-us/library/aa915939.aspx ...

How Can I Clone a Camera Source DirectShow Filter?

I'm doing some stereoscopic work which means I have need to work with two instances of various filters (i.e. a camera source that receives an IP stream), and this is proving not to be trivial. I even tried copying the IPCamfilter.ax to IPCamfilter.ax and manually making new CLSID entries in the reg, and the clone shows up, but won't wor...

C# check if COM Object is available before performing some action on them

Hello. How can i check if COM Object exists (is registered / is available / can run without problems) before running actions using them? My application should use other applications COM's (InteropServices) but before i start some action, i would like to check whether i can create COM objects. It woudnt be a problem if COM's where in sa...

Cannot call COM object created from STAThread from oher STA threads

I am new to COM and trying to understand the difference between STA and MTA. I tried to create an example that would show that COM can manage calls to object created in STA that is not thread-safe. MyCalcServer class here is created using ATL Simple Object. The settings used are the same as in this article: Threading Model: Apartment...

COM - How to get the properties of an interface within the type library the interface is defined

How to get the properties of an interface within the type library the interface is defined, Keeps returning HRESULT but would like it to return the actual value of the property. EDIT: IDL: interface IMyClassInterface : IDispatch { [propget, id(1), helpstring("Gets user Type")] HRESULT getUserDefineTypeVal([out,retval] UserDefineEnu...

.NET COM Interop with references to other libraries

Hello,I'm up against a problem when loading a class in a managed library from a COM Interop library. basically I have some Unmanaged C++ code and a COM Interop library written in C#. And finally a 3rd library which is referenced by the COM Interop library which contains a class: public class MyClass{ public MyClass(){} } What I'd l...

Notes Sessions Vs Lotus Session COM API Issues

I maintain a fairly large application which does a lot of talking with Lotus Notes. Recently in the last couple of months, some users have been having problem connecting to the Lotus Notes Session, I use the following code to get the session Set Session = CreateObject("Notes.NotesSession") This error seems to be popping up only for a c...

C# shared memory between C++ application and C# application using COM object

Hi Guys, Is it OK/possible to have a shared memory in a COM object which will be consumed by applications built using C# and/or C++? Can C# access shared memory in COM object without crash? Thanks, Adi Barda ...

Why Microsoft is still sticking to COM technology..

Is there any reason why microsoft is still sticking to COM technology(Office components are still COM).. when all that is done with COM is do-a-ble with .Net in a better and efficient manner ...

Can you call a .NET 2.0 COM object from an ASP.NET 1.1 web app?

We have an ASP.NET 1.1 web application. It invokes a C++ COM object which in turn invokes a .NET COM object. Originally, this .NET COM object was a .NET 1.1 assembly. Now, we need to modify this .NET COM object and in the process we now use Visual Studio 2008 so it is a .NET 2.0 COM object now. We now find that our ASP.NET 1.1 web applic...

How do I use a COM DLL with LoadLibrary in C++

First, COM is like black magic for me. But I need to use COM dll in one project I'm working on. So, I have a DLL I am developing and I need some functionalities that are available in a separate COM DLL. When I look to the COM DLL with Depends.exe I see methods like DllGetClassObject() and other functions but none of the functions I'm i...

C++ calling managed COM object can't find dependent assemblies

I've created and registered a managed COM library in C# on my development machine. I've successfully registered it and created a .tlb file with regasm, and successfully imported the tlb into a c++ console app used for testing. My COM assembly is called "efcAPI.dll" and it references another assembly that has not been set up for COM or r...

Creating an ATL COM object that implements a specific interface

I need to implement a simple ATL COM object that implements a specific interface for which I have been given both a .tlb file and a .idl file. The interface is very simple and only consists of a single method. I have created many ATL objects in the past but never one that has to implement a specific interface. What do I need to achiev...

Releasing temporary COM objects

Consider the following C# code using a COM object. MyComObject o = new MyComObject; try { try { var baz = o.Foo.Bar.Baz; // do something with baz } finally { Marshal.ReleaseComObject(baz); } } finally { Marshal.ReleaseComObject(o); } This will release the COM objects o and baz, but not the temporary objects returnd by...