I have a .NET assembly. It happens to be written in C++/CLI. I am exposing a few objects via COM. Everything is working fine, but I cannot for the life of me figure out how to return an array of my own objects from a method. Every time I do, I get a type mismatch error at runtime. I can return an array of ints or strings just fine.
...
Building a file open dialog replacement. Much of it works now, but I would like to generate the view-mode drop-down for the toolbar directly from the shell view object.
Looking at IShellView2, I can see IShellView2::GetView() will give me the FOLDERVIEWMODE's supported. However, that doesn't give me the names of these modes, nor forma...
Hi,
I am trying to add a button to one of the existing tool bars in any windows explorer instance.
After much research i figured out that BHO (browser helper objects) are the best way to hook
to windows explorer.
My question is :
Is that the correct way to go about it ?
In the SetSite of the BHO i get the comObject that is the e...
I'm confused about COM string assignments. Which of the following string assignment is correct. Why?
CComBSTR str;
.
.
Obj->str = L"" //Option1
OR should it be
Obj->str = CComBSTR(L"") //Option2
What is the reason
...
I have read that the following code causes memory leak. But did not understand why.
CComBSTR str;
pFoo->get_Bar(&str);
pFoo->get_Baf(&str);
How does it cause a leak when we are not allocating anything?
...
Seems like both COM_INTERFACE_ENTRY_IID and COM_INTERFACE_ENTRY2_IID are for the case when the class is derived from two or more classes each derived from a common interface. Like this:
class CMyClass : public IPersistFile, public IPersistStream {
};
(both IPersistStream and IPersistFile derive from IPersist).
Looks like I'm free to...
I need to create a service. I know that you can do it with just a console application but it can also be done with ATL.. What are the benefits of the ATL Service vs a simple console application service? I understand that ATL is COM.. but what are the benefits of COM with the service.. thanks!
...
I'm compiling my own DLL comprised of several .o files. One of the .o files has a function that calls SHLoadLibraryFromItem that is supported on Windows 7 only. The function is never called unless the application that uses the DLL is running on Windows 7. (Yes, I'm sure.)
However, when running the application on an older version of W...
This MSDN article states that any ProgID must meet several formal requirements, length restriction included. However nothing is said about what happens if those are violated.
I found several places in our codebase where ProgIDs are longer than 39 characters, still everything seems to work allright for them, ProgIDFromCLSID() and CLSIDFr...
Whenever I put my component into COM+ and call CoCreateInstance() on the client the following happens:
the runtime instantiates the objecs (calls IClassFactory::CreateInstance())
the runtime calls QueryInterface() for the interface specified in teh CoCreateInstance() call
the runtime calls QueryInterface() for IdentityUnmarshal interfa...
Hi there,
I'd like to enumerate all IDispatch supporting objects on a machine. At the moment I need to know what the class id or prog id is but, for inspecting my machine, I'd like to know if I can just enumerate all the objects that implement IDispatch.
Is this even possible?
Any help would be much appreciated :)
...
If I have multiple instances of a COM-enabled application running, can I specify which instance I want to talk to? Like, if I have multiple Excel spreadsheets open in separate windows, can I control which one I connect to?
...
Is there any way for a consumer to enumerate all interfaces implemented by a given COM object?
...
I currently have a .NET class library written in C# that exposes its functionaility via COM to a C++ program (pre-.NET).
We now want to move the library out-of-process to free up address space in the main application (it is an image-processing application, and large images eat up address space). I remember from my VB6 days that one coul...
Hello
I have created the ATL COM Server C++ project using Visual Studio 2005 wizard. I added a new COM class using the ATL Simple Object wizard. Now when I try to create this COM class instance from my server (calling CoCreateInstance within the ATL server) I get CO_E_SERVER_EXEC_FAILURE error from CoCreateInstance. When I try to create...
One can get the text of the selected item in the list-view of a common dialog. But one can NOT get its PIDL, and if the user has chosen to hide known extensions (the default), then one cannot really tell what file was selected without either its extension or its PIDL.
So possible ways to solve this might be:
Obtain an IShellView fr...
I am attempting to create an MMC snapin that among other things, will receive and display log events that are fired from my service. I have created the watcher and it fires correctly, but when I try to add nodes to my MmcListView, I am getting a COMException which says "COM object that has been separated from its underlying RCW cannot b...
So, I'm trying to implement a solution to a problem that I posted on superuser.
What I'm trying to do
I want to write a (Windows) application to synchronize podcast subscriptions in iTunes (and possibly iPhone/iPod touch apps, though I'll ignore them for now) between multiple computers that are using the same iTunes account.
How I'm p...
I know this may be a long shot so forgive me as I don't really know that much about COM.
Basically what I am trying to do is get the pointer to the IUnknown interface for a running application, the problem is the only thing I know about the app is its main window handle.
Would this be possible?
...
Hi all!
I have written an Excel COM Add-In in C++ for automation of Excel with VBA. It contains an own dialog showing some general informations about the Add-In.
Now i create a button in Excel that opens the dialog. Leaving the dialog with the escape key leads to an Excel message that the script is being interrupted instead of just clos...