com

C# - writing a COM server - Properties mapped to methods

We are trying to replace a COM server originally written for a VB6 application We have no access to source code. For some reason, the VB6 app can call our constructor, but then it gets: System Error &H80004002. No such interface supported. I assume when it tries to get the interface with QueryInterface. We have our assembly p...

How to evolve a COM interface?

COM is known to make backward-compatibility possible when releasing new components or applications. This is possible because interfaces in COM are stable i.e. they do not change. I tried hard to find a reference or book which deals with a descrition on how to evole a COM interface from version to version. The following are my requireme...

COM: How to retrieve CLSID? Can Prog-Id be used?

Hi, if I have a known COM library (the .ocx file itself) is there any way in C# to extract the CLSID info of it? Basically I need the same infos from the file Visual Studio adds to its project file when you add a reference to the file. Can these be retrieved from the ocx file directly or by searching the registry? Also if i know a prog...

Opening Excel and PDf files with Tcl Tk

Hello: I am having problems opening an existing Excel file with Tcl Tk. I am able to open an existing MS Word file with no problems. The code that I am using is as follows, also my test application has "package require tcom" included: proc OpenFile {} { #Path to file set app [::tcom::ref getobject "C:\\Users\\Me\\Desktop\\Test.doc"] ...

How does Install Shield "COM Extract at Build" work?

Our product contains a VC++ ATL in-proc COM server with two COM-exposed classes - ClassA and ClassB. This COM server is added into an Install Shield 2008 installer package and "COM Extract at Build" property is set for the component. ClassA and ClassB are exposed in exactly identical manner by the component - there's an .rgs file for ea...

C#: Powerpoint does not Quit?

Hello, I have a script that opens Powerpoint from my application and exports all slides. After that, I need the application to be closed. I've tried without any luck. Could you please help? using System; using System.Collections.Generic; using System.Text; using System.IO; using Powerpoint = Microsoft.Office.Interop.PowerPoint; using M...

Explore a COM Object in PHP

What would be the proper way to explode a COM object for debugging? I have a 3rd party function that returns a multilevel object. The documentation is non existant, so I'd like to be able to echo everything out of the object or debug it in Komodo IDE. Komodo just says Object and nothing else. Maybe convert to array? I know some of...

Should an implementor of IShellBrowser::QueryActiveShellView Method call AddRef for the caller?

I am attempting to implement an IShellBrowser. One method of such is: HRESULT STDMETHODCALLTYPE IShellBrowser::QueryActiveShellView(/* [out] */ __RPC__deref_out_opt IShellView **ppshv) This gets the active shell view pointer for the caller (in my case, there is only one shell view at any given time). But it is very unclear whether I...

Is it possible to cast a .NET class into a COM library class?

I am using the MathInputControl class in C# through the micautLib COM library. Example: MathInputControl mic = new MathInputControlClass(); mic.EnableExtendedButtons(true); mic.Show(); I am using Microsoft.Ink and I would like to be able to send an Ink object to the MathInputControl object through the MathInputControl....

Active X User Control COM/COM+ Communication

Alright, well I wanted a system of communication between my webpage and a web service. I don't understand much about writing a web service and a problem I had was the fact that the web service itself would not have a user interface where I could view the processes. Then I thought about making an "ActiveX control that will show a simple u...

one way communication from background exe to activex (sidebar gadget)

I need a small communicator between an application/background process and the gadget, I think its easiest to make own activex module that has just getText() and setText(). I need to pass a string once per second or so. I guess the activex object should use shared data so that another new activexobject() (created by javascript gadget pag...

Any good tutorials on using COM from C#?

Hello. For one of a side-projects i need to write a C# app that required to use a third-party INPROC COM object. Unfortunately, C# is not my primary programming language, so my knowledge is a bit limited. Is it any good tutorials available on how to access COM object from C#? The usage of this third-party COM object requires me to creat...

How to cast an PSafeArray item into its original type

Hi I am using an COM in Delphi 7 that was created in C# and one of the methods of a class return an array of an type. However, when Delphi imports it, instead of an array of that type I get an PSafeArray. How can I cast the items of that array into its base type? I've tried to use SafeArrayGetElement but I couldn't find a way of casti...

Is there an OS function to translate a REFIID to a helpful name?

Short of writing a function manually that translates a few known REFIID to names, such as: if (riid == IID_IUnknown) return "IUnknown"; if (riid == IID_IShellBrowser) return "IShellBrowser"; ... Is there a system call that would return a reasonable debugging string for well-known (or even all) REFIIDs? ...

When should I register my COM interface in HKCR\Interface?

Turns out there's a HKCR\Interface subtree where I can register my newly introduced COM interface. As I get it I would need it in two cases: if I want to enable marshalling - then I can register proxy/stub there if I want to publish more information on my component so that other developers could lookup the interface id and find it's hu...

SecurityException: That assembly does not allow partially trusted callers

From a C# WinForm project, I want to call a .NET COM method that already exist. I've added the reference to the COM, but I can't get rid of the SecurityException "That assembly does not allow partially trusted callers". Both projects are strongly named. I've added [assembly: AllowPartiallyTrustedCallers] at the top of the COM project, b...

XBAP uses unmanaged c++ COM server, Side by side deployment issue

Hi I'm facing a the following situation: I created a simple full trust XBAP application that refers to unmanaged c++ COM server (isolated). After deployment I expect that XBAP application will discover the COM server dll that is placed in the same directory, but it is not. I'm getting the following error: Exception has been thrown by ...

Need an explanation on iTunes COM persistent ID. Is the ID for a track same when its transferred to an iPod?

I am writing a JScript script with iTunes COM api for updating ratings and played count from the iPod database back into iTunes Library. In order to do so, the script should be able to recognize the songs that were transferred from this iTunes Library, so that it can read the ratings data for the track on iPod and update the correspondin...

what is the equivalent of COM in Mac OS?

I'm new to the world of Mac programming. Can someone please tell me what the equivalent of reusable COM components are in Mac and some links to a good resource to get started (in creating reusable COM-like components and referring those components from a calling app)? Thank you. Clarification: - I wish to know if there exist a similar t...

IHTMLDocument2->documentElement->outerHTML is too slow recreating HTML from DOM, is there a faster way?

Hi, I've got an IE BHO plugin that sends out via a COM call the HTML of a page that was loaded in the window. // Note all error handling removed for readability :) STDMETHODIMP CPlugin::get_HTML(long lMaxSize, BSTR *pbstrHTML) { CComPtr<IDispatch> pDispatch; MSHTML::IHTMLDocument2Ptr pDocument2 = NULL; MSHTML::IHTMLDocument3Ptr pDocu...