com

Word Automation InvalidCastException RPC / COM Exception

Hello I'm developing word automation application and I'm facing serious issue with unexpected RPC/COM cast exception [System.InvalidCastException: Nie można rzutować obiektu modelu COM typu 'System.__ComObject' na typ interfejsu 'Microsoft.Office.Interop.Word._Application'. Ta operacja nie powiodła się, ponieważ wywołanie...

Why isn't my IE MIME filter being created or called?

I'm trying to create a MIME filter to do some custom processing of resources received with web pages before passing them to the web browser control in our Windows application. The application is written in C#, and I'd like to write the MIME filter in managed code as well, if possible. I'm having trouble with it though: my filter object...

How can I find out about undocumented .NET / COM library functions?

How can I find out the properties and methods of COM objects returned from some .NET functions, which do not appear to be documented? In the particular example I'm looking at, I'm inserting a picture into Excel using a function like: Set NewPic = ActiveSheet.Pictures.Insert(FileName) (See the SO post on this here.) However, the MSDN...

Best way to call .NET classes from PHP?

What are the best options for connecting PHP apps to logic located in .NET libraries? PHP, since v5.0, supports a DOTNET class that is supposed to let me invoke .NET logic from a PHP script. But it seems there are many problems - I've not been able to get it to work reliably, with arbitrary .NET classes. The doc is sort of slim and wha...

Beginning C++ problem; cannot instantiate abstract class (C2259 in VS)

I'm attempting to create a concrete instance of the IAudioEvents COM interface (available in Vista and later). This is my first foray into COM programming, so I'm probably just doing something stupid here. Anyway, the following code fails to compile with "C2259: 'AudioEndpointVolumeNotifierImpl' : cannot instantiate abstract class". C...

How to implement a custom COM interface in Java

I need to pull some data from java into C#. I am already exposing my C# classes via COM. So I thought a good way to pull data from java would be to expose IReadStream from C# and implement IReadStream in java. I can then send an instance of the implementation as a parameter to C# so that I can call IReadStream.Read in C#. How do I imple...

How do I access the classic Internet Explorer COM automation object for a running instance of Internet Explorer from Powershell?

How do I access the classic Internet Explorer COM automation object for a running instance of Internet Explorer? That is, if I have Internet Explorer open in multiple windows, how do I associate the COM object corresponding to one of those windows with a variable in Powershell, from within Powershell? The closest I have come to doing thi...

What's the difference between calling CComModule.RegisterServer, _AtlComModule.RegisterServer, and LoadTypeLibEx for TypeLib registration?

In my DllRegisterServer method of my COM dll, I previously had code that called LoadTypeLibEx(module, REGKIND_REGISTER, &pTypeLib) to register my COM classes and their corresponding TypeLib's. My COM DLL is a 64-bit. I've noticed that on my 64-bit Vista system, under HKCR:\\TypeLib\{myguid}\1.0\0 I find a win32 subkey with the location t...

How determine the PID of a process that was started by instantiating a COM coclass?

Is there any way to determine the PID of a process that was started by instantiating a COM coclass? For example: MyApp.ApplicationClass anApp = new MyApp.ApplicationClass(); would start the process myapp. Potentially there are already a lot of myapp processes running when this code is executed. My current solution to acquire the la...

Com Interop w/ MSXML

I'm trying to COM interop w/ Navision through a .Net assembly - and specifically using MSXML interfaces. This leads to the following error message: The assembly "C:\Users\bra\Documents\Visual Studio 2008\Projects\SOAPROXY\SOAPROXY\bin\Release\SOAPROXY.dll" could not be converted to a type library. Type library exporter encountered an er...

Will upgrading Office from 2003 to 2007 break VB programs which use Excel through the COM interop?

Assume all traces of Office 2003 will be removed from the computer. UPDATE: I understand that I will still be able to use .xls files. I'm asking about automating Excel through the COM interop from outside Excel. When I add a reference to Excel to a VB project, it gives me a different version of the dll for different versions of Excel. ...

Changing TextRenderingHint in a C# COM control causes all forms to stop using hinting

My application C# IDeskBand COM component. I'm drawing a custom control to a transparent Bitmap and then the IDeskBand control draws that Bitmap. ClearType doesn't render properly on a transparent background (logically), so I use g.TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAliasGridFit; The problem is that after ...

How to use COM in VBA for Word?

I am working with VBA, in Microsoft Office 2007 and 2003 (Word specifically). What I need is to use a custom COM object from VBA and use its methods. I already do it in Word 2007 but it crashed in Word 2003. This is the command that I am using: Dim oCOM as Object. Set oCOM = CreateObject("COMDLL.COMObj") I got this error:...

Hold COM-reference in .net web service

I have tried to make a webservice interface to a state-holding COM component. The webservice basically contains operations Start, Shutdown and GetCurrentState. Start creates a COM component, Stop releases. And GetCurrentState retrieves information from the COM component. It seemed an easy thing, but after a day it still refuses to wo...

Delphi Froze when registering type library

Hi: I have created a few AUTOObjects using Delphi and its type library. It compiles without error, but when I tried to register it, Delphi froze, and doesn't return to normal. I have tried to register it in both Delphi 7 and 2006, but both get into the same problem. I tried to register a simple library in Delphi's demo, I am ruling out ...

Should out params be set even if COM function fails?

When implementing a COM interface I always assign to the out parameters on success but should I do so also on error? HRESULT CDemo::Div(/*[in]*/ LONG a, /*[in]*/LONG b, /*[out,retval]*/ LONG* pRet) { if (pRet == NULL) return E_POINTER; if (b == 0) { *pRet = 0; // is this redundant? return E_INVALIDAR...

Windows 2008 DCOM problem

Hi, I have an DCOM server and when a process calls a method that changes the password of an user the next petition fails. This problem only occurs when the machine is a Windows 2008 working as Domain Controller. Anyone knows how to fix it? Thanks EDIT: There is an audit security error with the code 4625, I have been searching in goog...

Compare type libraries generated by TLBEXP

Type libraries generated by TLBEXP can have identifiers that differ by case: http://social.msdn.microsoft.com/Forums/en-US/clr/thread/5003c486-ed3f-4ec8-8398-a1251b0f9e74 I've also noticed that the order that types appear in the exported type library can change from one build to another. Does anyone know of a tool to compare type libr...

PHP : Creating a folder in the registry

How do I create a new registry value using PHP? The following code doesn't work: function registry_write($folder, $key, $value, $type="REG_SZ") { $WshShell = new COM("WScript.Shell"); $registry = "HKEY_LOCAL_MACHINE\\SOFTWARE\\" . $folder . "\\" . $key; //$result = $WshShell->RegRead($registry); $result = $WshShell->RegWrite(...

Programmatically determine if a COM library (.DLL) is installed

Is there a programmatic way in C# to determine whether a particular COM DLL has been installed? Or is this a matter of scanning the registry for the classId? ...