com

Automating Outlook and Word to create email message

I'm trying to create a Word email message that will be used as the body for an Outlook message. I've been looking at sample code from Microsoft here but this code falls over when trying to create the new word document at the wordApp.Documents.Add line: Word.Application wordApp = new Word.Application(); object template = Syste...

Registering in COM+ expose less interfaces than Regsvr32

I've been using a 32 bit COM library by registering it with regsvr32 and all works fine. Since I need to access it from a 64 bit process, I'm now registering it as COM+ through the Component Services administrative tool. Problem is, it seems that not all of the COM interfaces are exposed anymore. What could be the reasons for this? ...

Sending binary data from ASP to .net component

The ASP application allows uploading of image files (jpg, gif, tif). These files are sent to a .net component registered in the GAC of the server. In the component file is encoded using System.Text.Unicode to byte[] array. This encoding is done with some data loss. The byte array has values 253 and 255 in consequetive elements. What cou...

Exposing C# struct to COM breaks for VB6 app

Last Updated: 2009-08-11 2:30pm EDT A few days ago I posted this question about some very strange problems. Well, I figured out what specifically was causing a build on one machine to not run on others and even came up with a work-around, but now it leaves me with a nice, specific question: Why? To reproduce the problem, I create a new...

What is the closest thing to Windows COM/DCOM in the Linux world?

Anything higher-level, and more comprehensive than pipes/sockets? ...

how to call COM object from classic ASP

Hello everyone, How to call COM object from classic ASP? I tried hard but cannot find a good tutorial. Any recommendations? I am using C# in classic ASP. thanks in advance, George ...

Problem in hosting ActiveX on Vista (in a Visual Studio 6 C++ application)

Hello everyone, I just installed Visual Studio 6 (SP5) on a Vista Enterprise machine. Had some problems but I think it’s set up alright. The problem is my VC++ 6 application fails when trying to host an ActiveX. I was able to compile it ok, though got a warning message from Vista about the rc.exe (“This program has known compatibility ...

Hooking thread exit

Is there a way for me to hook the exit of managed threads (i.e. run some code on a thread, just before it exits?) I've developed a mechanism for hooking thread exit that works for some threads. Step 1: develop a 'hook' STA COM class that takes a callback function and calls it in its destructor. Step 2: create a ThreadStatic instance of ...

Why do COM libraries used from C# 4.0 require such heavy use of dynamic types?

In the C# 4.0 demos, I'm seeing lots of code that uses the dynamic type. For example, the following code sets the value of an Excel cell: excel.Cells[1, 1].Value = ... However, you can also access the cell in an early bound manner with a cast: ((Range)excel.Cells[1, 1]).Value = ...; Why don't the Excel COM library just describe the C...

How to bulid the exe that behaves same in all machines.

Hi I am facing a variety problem is explained below. I have created a c# class library(Test.dll) using which i can enumerate the list of instances and databases of sqlserver. I have 2 Machines 1 dev machine and 2 one is test machine. Now when i testing the Application in my dev machine it is properly behaving. But when i copy the app...

C# 2005 COM and .NET Access Denied 0x80070005 E_ACCESSDENIED

I am rewriting a C++ app in C# 2005. The App has 2 components: one out-of-process COM server which can be started by a C++ service. The COM server uses outgoing interface, meaning it invokes event handler method from the C++ service module upon certain event. I am rewriting the C++ service part. Right now I have jut developed an app t...

Git, Windows and COM binaries

Hi I've been using git on windows in a semi-manual mode. I have several repositories for various versions. Each version has a different set of binaries so if I change versions I need to unregister the old binaries and and register the new. Previously I have simply been creating a new git repo for each version, then reg'ing/unreg'ing the...

Retrieving the COM class factory for component error while generating word document

Hello, I am trying to edit a word document from VB.NET using for the most part this code: How to automate Word from Visual Basic .NET to create a new document http://support.microsoft.com/kb/316383 It works fine on my machine but when i publish to the server i get the following error. Retrieving the COM class factory for compone...

How to prevent coclass implementations from being exposed in an ATL type library

I am building an ATL type library with a type of class factory. Something sorta like this: [ object, uuid(...), ... ] interface INumber : IDispatch { [propget, id(0)] HRESULT Value([out, retval] LONG* pVal); } [ object, uuid(...), ... ] interface INumberFactory : IDispatch { [id(1)] HRESULT GetNumber([in] BSTR numberName, [out,...

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 assembly. On the classic asp website, i call it...

how to import a tlb file programatically in c++??

Currently I am using the statement: #import "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\test.tlb" named_guids But I am getting the folder path programatically. i.e., "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727" I have to load test.tlb from this path which resides in a variable say, folderpath. I have to import the tlb programa...

Problem in hosting ActiveX on Vista (in a Visual Studio 6 C++ application) II

Hi, (I'm re-posting this message since I signed up as a user now) I just installed Visual Studio 6 (SP5) on a Vista Enterprise machine. Had some problems but I think it’s set up alright. The problem is my VC++ 6 application fails when trying to host an ActiveX. I was able to compile it ok, though got a warning message from Vista about ...

How can I successfully implement IDocHostUIHandler in .NET?

I've a webbrowser control and I'm trying implement IDocHostUIHandler in the container. However since I don't have a default IOleClientSite I can't forward all events to a default container. And I couldn't find a way to response all of them, giving wrong responses to some of the events or not doing anything causing application to crash. ...

Can I use window.external in after using SetClientSite?

How can I use window.external after using SetClientSite in Webbrowser Control without implementing IDocHostUIHandler? ...

Who takes ownership of the IErrorInfo?

We use Native COM support in our code havily. Everything's fine except that we don't like the fact that on error _com_raise_error() is called which throws a _com_error exception. Since we have our own hierarchy of exceptions catching this _com_error is inconvenient - it's not in our hierarchy and even doesn't inherit from std::exception....