com

Python 3.0 Windows/COM

How to access a COM object from a python file using python 3.0. And, yes, I know that not a lot of people are using Python 3.0. Switching back to 2.6 is a huge hassle for me, so I don't want to unless I absolutely have to. I appreciate your time, and any assistance! ...

Event (com library) - Update GUI

I got a financial library (com) that call an event each time a price is change. I subscribed to this event and try to update a textbox, but I always get a cross-thread operation. Fine, I use delegate, but it's doesn't work at all... it's freeze the application. My hypothesis is that the event is call to quickly, before the GUI have time ...

COM vs WMI for Information providing

What is better method to use if I would like to provide the user with some information about my Hardware device. Should I develop a proprietary COM Library or should I develop a WMI provider? ...

Registering implementation of a COM interface

I'm new to COM programming. I've got a COM object (and associated IClassFactory) all ready to go, but I can't quite figure out how to go about registering the resulting DLL for use by other programs. The number of GUIDs I need to sling around is also unclear to me. The COM object I'm trying to register implements the IAudioSessionEven...

Returning an array from JS to C# with COM-Interop

I'm returning some data from my JavaScript code to my C# code via COM Interop and the WebBrowser WPF control. I have successfully returned the data which looks like this in Javascript: var result = new Array(); result[0] = cbCamera.selectedItem; result[1] = cbMicrophone.selectedItem; Now I have the object result in C# which looks li...

WMEncoder randomly dereferences during execution

I have a program that converts lots of audio using WMEncoder. Sometimes during execution I get the following error: System.Runtime.InteropServices.COMException] Retrieving the COM class factory for component with CLSID {632B606A-BBC6-11D2-A329-006097C4E476} failed due to the following error: 80040154. WMEncoder is installed and some fi...

Broken COM object registration

This is a continuation of Register implementation of a com interface ; only now I've got actual code that needs debugging. I've got two COM objects, one that implements IAudioSessionEvents and one that implements IClassFactory and produces the first object. The following code registers those objects (in accordance with my understanding...

Can you prevent SndVol from displaying empty audio session?

I've been playing around with Vista's CoreAudio stuff, in particular IAudionSessionEvents, with the goal of monitoring the default audio session for changes to volume caused by loaded code. However, it looks like as soon as you install an IAudioSessionEvents listener SndVol lists the program with all associated volume controls. As a go...

Storing a COM pointer in a struct

My program is crashing every time I try to store a COM pointer into a struct, and then later try to use the original pointer. I don't have debug access to tell exactly what's wrong. pRend->cp = cpRT; ID2D1SolidColorBrush *scBrush; ERF(cpRT->CreateSolidColorBrush(D2D1::ColorF(D2D1::ColorF::CornflowerBlue), &scBrush)); It crashes on Cr...

Initialize Critical Section only once for a process

In a multi threaded application, is there a way to ensure that a Critical Section is initialized only once except for putting the code in DLL main() ?? ...

problem with IHTMLDocument2::write()

I am trying to create an mshtml document object from an html buffer. But when the following code is executed it is invoking internet explorer window. How do I prevent it invoking IE. #include <atlbase.h> #include <mshtml.h> CoInitialize(NULL); CString strHTMLCode = _T("<html><head><script language=\"JavaScript\">{top.location.href=\"...

Somehow COM object instance gets lost

I have a main app and a type library contains 2 COM objects, one is IFile, one is IFiles. IFiles creates IFile, and stores them in a TLIST, and has standard methods like Add, Remove etc. Both IFile and IFiles are TAutoObject. "Add" method in IFiles is working fine, it simply creates IFile object [Code 1], and adds it to TList. Problem i...

Foreach fails with a marshalled COM interface

We have a 32-bit COM component written with ATL in C++. When there's a need to use it from 64-bit .NET, we create a COM+ application and everything works allright. Recently we noticed strange behaviour on Win2k8. The COM object in our component fires an event and we process it in .NET code. The event has a parameter also passed from the...

IAudioSessionManager2 notifications not sent

I'm trying to monitor new audio sessions via Windows 7's IAudioSessionManager2 COM interface (coupled with IAudioSessionNotification). Currently, IAudioSessionNotification::OnSessionCreated() is never called and I've run out of ideas as to why. Code registering custom IAudioSessionNotification: #define SAFE_RELEASE(comObj) \ if(comObj...

Get ProgID from .NET Assembly

I want to write a program to find all the com visible .NET classes, and their ProgIDs from a .NET assembly. What's the best way to do this? ...

using an object from one specific thread

i have a COM object that i am using in dotnet and i have to call it always on the same thread. The issue is that conceptually it is being for multiple things throughout the program. What is the best way for ensuring that all uses of this object on called on this one specific background thread? Example code would be great. ...

Excel type library / Delphi 2009/ bad variable type

We have just updated an application which uses the Excel type library to Delphi 2009 from Delphi 2006. What I am finding is that nearly nothing now works - nearly any call to Excel results in a message "Bad variable type.". For example we may do: Sheet.Cells.Item[Row, Column].Value := Value where Sheet is an ExcelWorksheet and Value is a...

Search Outlook directory

Hi, I'd like to know if it possible to search for people in Outlook directory via the Outlook COM component. If so, how? I've referenced the COM component and created a Microsoft.Office.Interop.Outlook.Application object in my C# code, but I don't know how to go further. What I wnat to do is have a first and last name as input, and be ...

IIS Web Service calling COM dll that needs to access a unix file share

We have a web service that uses COM to talk to some DLLs. The data files that the DLL functions rely on are on a unix share, and we must specify the data file location when initializing the COM calls. We have installed SFU 3.5 on our Windows Server 2003 server. We can't use a mapped drive because IIS is running as a service (or can we?)....

What is COM?

I searched hard, but was unable to grasp the whole idea. Can anyone tell me: What COM actually is? How do GUIDs work, and how are they used by COM? How does COM resolve the issues of different DLL versions. Or at least, point me to a good article somewhere that explains these concepts? Thanks! ...