com

What's the purpose of COM+ library applications?

When a COM+ application is created the wizard offers to choose between a library and a server application. A server application is activated in a separate process and this can be used to cheaply interop 64-bit consumers with 32-bit in-proc COM components. What's the use of library applications that are activated right in the caller pro...

Difference between COM DLL & ActiveX control

Few similarities I know.. Both cannot execute by themself. It needs some program to instantiate it. COM DLL & ActiveX controls are platform independant.. (Is it so..?) Both requires to support the interface IUnknown & exposes three methods QueryInterface, AddRef, and Release It also requires be registered before using & un-registered a...

Hooking the windows COM runtime

Hi, Is there an available tool which hooks the windows COM runtime? I want to be able to see all the instances which get created, view queries to their interfaces, method calls, etc. Thanks! ...

Can .local files be used during VB6 compile to avoid registering COM ocx and dll files

In an attempt to keep my build machine clean can .local files be used during the compile of an application or is there a better way to keep the bloat off the machine. ...

How to obtain the PIDL of an IShellFolder

If I have an IShellFolder interface pointer, how might I obtain its PIDL? I can see how to enumerate its children, and I can see how to use it to compare any two children... but how might I get its own pidl? I ask because I'd like to know "Is this IShellFolder == Another IShellFolder". I can use IShellFolder::CompareIDs() - but I have...

How to do registration-free COM in a plug-in architecture

We use manifest files to do registration-free COM, as I've also elaborated on in this other question. Now we're trying to use registration-free COM with an application that supports plug-ins. The plug-ins are OCX files that can be added to the main application's folder after the main application is already installed. However, that mea...

What is the "Shell Namespace" way to create a new folder?

Obviously this is trivial to do with win32 api - CreateDirectory(). But I'm trying to host an IShellView, and would like to do this the most shell-oriented way. I would have thought that there would be a createobject or createfolder or some such from an IShellFolder. But neither IShellView nor IShellFolder nor even IFolderView seem to...

AccessViolationException in COM control in .NET app

I'm working for a client that has a VB6 app in the migration process to .NET. Currently they have a .NET shell, but host some old VB6 controls in .NET. There's an error I stumbled upon is logs that happens when they in .NET asynchronously pull some data from the database, and then forward that data to a COM component to display it: The...

Out of memory on _beginthreadex

I currently debug a multi threaded application, which runs without errors until some functions where called about 2000 times. After that the application stops responding, which I could track down to _beginthreadex failing with an out of memory error. When examining the Application in ProcessExplorer I can see a growing number of thre...

How does one return a local CComSafeArray to a LPSAFEARRAY output parameter?

I have a COM function that should return a SafeArray via a LPSAFEARRAY* out parameter. The function creates the SafeArray using ATL's CComSafeArray template class. My naive implementation uses CComSafeArray<T>::Detach() in order to move ownership from the local variable to the output parameter: void foo(LPSAFEARRAY* psa) { CComSafeA...

CoCreateInstance returning E_NOINTERFACE even though interface is found

I have a COM class CMyCOMServer implementing IMyInterface in one application, both with correct GUIDs. CMyCOMServer::QueryInterface will return S_OK (and cast itself to the right type) if IUnknown or IMyInterface is requested, otherwise it returns E_NOINTERFACE. In another app on the same PC, I call: HRESULT hr = ::CoCreateInstance(__u...

how reliable is the COM extension from PHP 5?

I am playing around with the PHP5 COM extension http://de3.php.net/manual/en/book.com.php by creating my own dll in C# and using types from it in PHP. Apart from the minor annoyance that my dll apparently has to be installed in the GAC my toy app did work. I am wondering if anyone used the COM extension in a realworld project. What ...

Building a Com addin for Office 2000 / Office 2007

I am struggling to find a straight forward guide to creating office addins using VSTO and VB.net. Specifically I would like to know how to be able to create a addin/ dll which can either be referenced from VBA in the form:- Addin.method(argument) or Addin.property = X Or which would install its own custom toolbars/ ribbon interface to...

Class not registered

Hi, I'm working through "Developer's Workshop to COM and ATL 3.0" by Andrew W. Troelsen. I'm trying to implement the lab in Chapter 3. It shows you how to build a COM client to connect to an inprocess COM server that was developed in an earlier lab. When I run the client, I receive the error "Class not registered" when calling 'CoGet...

Controlling the volume of other applications

I am trying to make an app that controls the volume of another process using the Windows 7 Audio API. What I'm looking for is the ISimpleAudioVolume for the session used by the other process. I have tried using the IAudioSessionEnumerator but it will only give me the IAudioSessionControl2 of the session. Using the IAudioSessionControl ...

Copying between VARIANT and _variant_t

I'm fairly certain that I can safely do: void funcA(VARIANT &V,_variant_t &vt) { vt = V; } But what about the other way around: void funcB(VARIANT &V,_variant_t &vt) { V = vt; } I've been seeing some REALLY weird behaviour in my app which I put down to COM-related threading issues. But then I got wondering if I was screwing...

MFC Automation how to implement RemoveDocument OnCloseDocument

I have an MFC MDI Application and I am trying to implement Automation with it. I am trying to create a RemoveDocument. How is that done? OnCloseDocument is causing problems. Is there a "standard" for doing that? ...

Getting COM Exception 80040154 on different machine

Hi All, I am getting following problem, can someone help please? I used Tlbimp utility and converted VB6 COM DLL into RCW DLL. From my Visual Studio 2008, I used "Add Reference" and used that DLL in c# class. Everything works fine on my machine. But if someone else use the same project on his/her machine then on that machine they get fo...

C++ and C# COM Event Performance. Help.

Hi All, Good day. CppApp and CsApp Event Handle Design Changed. For Industry application. Old design. CsApp pull event from CppApp. There are a lot of events from CppApp. So we created two threads in CsApp to handle the events from CppApp. It worked very well. New design. CsApp and CppApp com event (fire event method) design inst...

How to build a SAFEARRAY of pointers to VARIANTs?

I'm trying to use a COM component with the following method: HRESULT _stdcall Run( [in] SAFEARRAY(BSTR) paramNames, [in] SAFEARRAY(VARIANT *) paramValues ); How can I create in C/C++ the paramValues array? ...