com

How to force process isolation for an out of process COM server?

I'm writing managed code that has to interact with a vendor's COM automation server that runs out of process. I have found that this server becomes unstable if more than one client connects to it. For example, if I have managed code in process A and managed code in process B both connecting to this COM server, a single process will be ...

Launching and controlling a new application instance via COM

I'm using C#.NET to launch and control a Delphi-written executable. The Delphi application has a COM interface. I've imported the Delphi executable -- we'll call it DelphiApp.exe -- into Visual Studio as a resource. The following C# code works -- if no other instance of DelphiApp.exe is running: DelphiApp.DelphiAppClass da = new Delp...

How to make WebBrowser to save its content as an MHT file?

Internet Explorer can save its content as an MHTML file using the "Save As..." menu command. Is this feature exposed by its COM interface? ...

How to pass an interface pointer to a thread?

Note: Using raw Win32 CreateTheard() API No MFC An interface is simply a pointer to a vtable Question: How to pass an interface pointer to a thread? Illustration: IS8Simulation *pis8 = NULL; ... CoCreateInstance( clsid, NULL, CLSCTX_LOCAL_SERVER, __uuidof(IS8S...

Entrypoint of an OCX

What are the entrypoints of an ocx ? are they same as that of com dlls ? ...

Delphi 2009: Is it possibly dangerous to use TList<[any interface]> with default comparator?

Hello everyone, I am wondering if the usage of a generic TList<T> where T is any interface type (except IUnknown/IInterface) might be dangerous. I am heavily using interfaces and store them in lists. Some interfaces are my own, some are provided by some COM-interfaces, so COM is involved. I see a potential problem where checks for inst...

Lua COM Programming

Anyone know of any examples that shows COM programming via Lua? Could require a library. I need to write some external scripts for Photoshop, so wondering if it's possible with Lua. ...

Is there any safe way to keep member pointers to COM objects from another dll in a singleton COM object?

I recently ran into a problem with a COM object that was using a singleton class factory and had members that were pointers to other COM objects implemented in a different dll than the singleton object. These other COM objects were created by the singleton object and that was the only reference to them. Since the singleton object is ne...

Control 2 separate Excel instances by COM independently... can it be done?

I've got a legacy application which is implemented in a number of Excel workbooks. It's not something that I have the authority to re-implement, however another application that I do maintain does need to be able to call functions in the Excel workbook. It's been given a python interface using the Win32Com library. Other processes can ...

COM C# Memory leak Tracing

Is there a way to find out the memory usage of each dll within a c# application using com dll's? Or what would you say is the best way to find out why memory grows exponentially when using a com object (IE. Whether the COM object has a memory leak, or whether some special freeing up of objects passed to managed code has to occur(and/or ...

How do I use OLE-DB to access a dbf file in an COM/C++ ATL application?

I need to access the data contained in a dbf file in COM/C++ application (created via ATL). How would I do that? I've been reading tons of msdn articles very instructive about the OLE-DB provider-consumer model. However, what I need now is a quick tutorial or code sample. Note: I am by no means no expert in COM/ATL programming :) Than...

Keeping a DCOM object alive from Java server on a REST invocation

Hi, I'm implementing a REST API for my Java server. One of the of the resources obtained through the API is actually creating a C++ DCOM object and reflecting its values. The Java to COM bridge I'm using is J-Integra. The problem is that I need to keep that DCOM object alive for subsequent REST calls, but the object is alive just as lo...

Why does my application not close on logoff/shutdown (c#/.net winforms)?

My winforms app isn't shutting down nicely when I log off/shutdown. I have a main form, whose Closing event is fired correctly, but there must be something else keeping my application around. If I check Application.OpenForms there's just my one main form. The tricky bit, and where the problem probably lies, is that my application uses S...

Is there a way to decode numerical COM error-codes in pywin32

Here is part of a stack-trace from a recent run of an unreliable application written in Python which controls another application written in Excel: pywintypes.com_error: (-2147352567, 'Exception occurred.', (0, None, None, None, 0, -2146788248), None) Obviously something has gone wrong ... but what?[1] These COM error codes seem to be...

event notifications not received as described

Problem: Event notifications (From COM object - Server) are not received as listed in the Sink (class) implementation. One event notification is received (Event_one), however, others are not received accordingly If order is changed - in IDispatch::Invoke, that is: if Event_one is swapped to Event_two then Event_two notification rece...

Is is possible to insert an image into an excel cell via COM?

I have used automation to insert values into a cell, however I have never seen any documentation, for example, that demonstrate inserting anything other than text and/or formula's. Has anybody been able to insert an image from an external application? ...

Testing the rendering speed of IE on a specific page

If my goal is to test the rendering speed in IE of a specific web page through repeated loads (merely using a javascript onload event for timing and viewing the page doesn't cut it), what would be a good way to do it? My current attempt was by using the IE WebBrowser object in VB and C#, though I'm open to other suggestions. Below is s...

Good tools for analysing COM object registry interference?

I have inherited two complicated COM objects. One was derived from the other and (allegedly) the GUIDs, etc., were all changed so that they should not interfere. They do interfere and so far our debugging has not identified the culprit -- we've done registry compares and source code diffs and looked through the SCCS checkins. Obviously...

Is there a better way (besides COM) to remote-control Excel?

I'm working on a regression-testing tool that will validate a very large number of Excel spreadsheets. At the moment I control them via COM from a Python script using the latest version of the pywin32 product. Unfortunately COM seems to have a number of annoying drawbacks: For example, the slightest upset seems to be able to break the c...

calling C# from c++ com add-in

Hi, I have a COM add-in written in C++ (not C++ / CLI). I want to call a C# library objects/methods from this C++ com library. I guess the CCW comes into picture here, which i am currently reading about. Are there any quick pointers to this stuff from your experience? Also, i have a method in my Com add-in that i would like my C# lib...