com

How to diagnose cause, fix, or work around Adobe ActiveX / COM related error 0x80004005 progmatically?

I've built a C# .NET app that uses the Adobe ActiveX control to display a PDF. It relies on a couple DLLs that get shipped with the application. These DLLs interact with the locally installed Adobe Acrobat or Adobe Acrobat Reader installed on the machine. This app is being used by some customer already and works great for nearly all us...

Invoking .Net COM assembly from Powerbuilder application (without registration)

We have a Powerbuilder 10 application that is using .Net COM assemblies. We are trying to embed the manifest in the PB application (to invoke COM assemblies without registration). The merged manifest file has added sections for dependecies on the .Net COM assemblies. We have tries various tools to inject the new manifest with different r...

Using Word COM objects in .NET, InlineShapes not copied from template to document

Using .NET and the Word Interop I am programmatically creating a new Word doc from a template (.dot) file. There are a few ways to do this but I've chosen to use the AttachedTemplate property, as such: Dim oWord As New Word.Application() oWord.Visible = False Dim oDocuments As Word.Documents = oWord.Documents Dim oDo...

What exactly is a Class Factory?

I see the word thrown around often, and I may have used it myself in code and libraries over time, but I never really got it. In most write-ups I came across, they just went on expecting you to figure it out. What is a Class Factory? Can someone explain the concept? ...

Newbie questions about COM

Hi, I am quite new to COM so the question may seem naive. Q1. About Windows DLL Based on my understanding, a Windows DLL can export functions, types(classes) and global variables. Is this understanding all right? Q2. About COM My naive understanding is that: a COM DLL seems to be just a new logical way to organize the functions and t...

How to collect Active X controls in the MFC dialog

I know we can enumerate the windows controls with in the dialog and using the callback we can collect the windows controls. I am looking for specific way to filtering out the controls based on interface implementation. For example, If the Active-X controls derives from interface IDataControl, I want that to add to my interest collection...

Exposing a .Net Service

I have written a Windows Service in .Net and I want to expose the classes to be called by other .Net code. Specifically, I have an API that I want to expose via a DLL that will be placed in the GAC, and I want the DLL in the GAC to use the classes of the .Net Windows Service. I need this architecture as the code in the Windows Service ...

Trying to use SHCreateShellItem, having #include issues

There is a function in called SHCreateShellItem which is declared in <shlobj.h>, but it has been #ifdef'd out based on whether or not _WIN32_IE is greater than or equal to 0x601 (if it is, then the declaration is present). However, even when I define _WIN32_IE to 0x601 before I include <shlobj.h>, MSVC++ still complains that SHCreateShel...

What happens if two COM classes each without a threading model are implemented in one in-proc COM server?

Consider a situation. I have an in-proc COM server that contains two COM classes. Both classes are marked as "no threading model" in the registry - the "ThreadingModel" value is just absent. Both classes read/write the same set of global variable without any synchronization. As far as I know "no threading model" will enforce COM to disa...

Scala Actors with Java interop to underlying COM libraries

I'm working on a JVM project which uses ESRI components (COM based, wrapped with JIntegra.) The client has requested the JAR files we produce work on the JVM and be accessible to Java code. I'd like to use Scala but I'm worried about how well the library will play with Scala's actors. Particularly I'm worried about the different mecha...

Inconsistency in passing objects from VBA to .NET via COM

I have the following interface defined to expose a .NET class to COM: [InterfaceType(ComInterfaceType.InterfaceIsDual)] [Guid("6A983BCC-5C83-4b30-8400-690763939659")] [ComVisible(true)] public interface IComClass { object Value { get; set; } object GetValue(); void SetValue(object value); } The implementation of this int...

Why doesn’t Office-applications get focus when run from another application on Win 2008?

I have some different COM-Interop examples that when run on Windows 2008 (Office 2007) always open minimized in the task bar. On Windows 2003 or XP they open like I want them to. Has there been any changes to how Windows deals with this? Or to Office? I know that I can close windows with CTRL-SHIFT-ALT, and by that get them to start m...

ATLComTime.h is part of what redistributable?

I added functionality to a code base someone else wrote and while the "Not using ATL" flag was set in VS2005 I see that there is #include <ATLComTime.h> in one of the files. I have only sent the C-Runtime library (see here) redistributable. The client can not get the code to worktheir machines. They receive a "DLL entry point not foun...

Where can I find a good description on how to use COM with Windows Services?

Hi there, I'm looking to pass parameters into a Windows Service not only upon launch but while it's still running as well. I've heard the best way to do this would be through the COM but I have no idea where to even get started. Are there any good places you can recommend where I can find some helpful information about how to get started...

What are the essential COM components required for burning DVD in Windows XP using .NET?

I'm trying to burn DVD/CD through frontend C# code... i have used IMAPI2 for buring CD/DVD in windows XP..but it is giving me unhandled exception... as:- System.InvalidCastException: Unable to cast COM object of type 'IMAPI2.Interop.MsftFileSystemImageClass' to interface type 'IMAPI2.Interop.MsftFileSystemImage'. This operation failed...

Excel not creating

i am trying to run the following code : Excel.Application xlApp; Excel.Workbook xlWorkBook; Excel.Worksheet xlWorkSheet; object misValue = System.Reflection.Missing.Value; xlApp = new Excel.ApplicationClass(); xlWorkBook = xlApp.Workbooks.Add(misValue); xlWorkShe...

Problem registering a COM server written for Excel registered on client machine (can't set full path to mscoree.dll)

In this previous question <How to get COM Server for Excel written in VB.NET installed and registered in Automation Servers list?> there is an example of how to create the full path to a registry key using VS 2008. Everything in the previous answer works correctly except the full path that I am setting (using the registry editor in VS) f...

Marshalling C# com items when using recursion

I am using the SourceSafe COM object (SourceSafeTypeLib) from C# to automate a SourceSafe recursive get (part of a larger build process). The recursive function is shown below. How do I ensure that all the COM objects created in the foreach loop get released correctly? /// <summary> /// Recursively gets files/projects from ...

From VB6 to .net via COM and Remoting...What a mess!

I have some legacy vb6 applications that need to talk to my .Net engine application. The engine provides an interface that can be connected to via .net Remoting. Now I have a stub class library that wraps all of the types that the interface exposes. The purpose of this stub is to translate my .net types into COM-friendly types. When I r...

Setting a MS Word document title using COM?

I'm using Jacob to create and add text to a MSWord document. I want to set the document title without saving the document. Is this possible? If so, what is the name of the property that I need to set to do this? (I tried wdPropertyTitle, which some MS VB tutorial used, but no beans.) ...