com

tlbinf32.dll in a 64bits .Net application

血红的双手。 提交于 2021-02-06 13:00:26
问题 It seems there is no 64 bits version of tlbinf32.dll , this (old) COM DLL is used to extract informations of COM components. (see this SO answer ) I need to access it from a 64 bits C# application. I did not manage to host it into a separate surrogate process, I'm still obtaining the exception REGDB_E_CLASSNOTREG . My code works for x86 platforms but I have to implement it also for 64 bits. Can any one help me by providing a step by step procedure to launch it into a surrogate ( Dllhost ) -

How to use 'SHCreateDefaultContextMenu' to display the shell context menu for multiple files from different folders

 ̄綄美尐妖づ 提交于 2021-02-05 10:56:14
问题 I want to create a function which displays the shell context menu for a given file list (as string), but the files are from different location on the shell namespace. (It is the same the context menu which is shown when you right click selected files in the search results area in Windows Explorer ) I saw that the issue was discussed in couple of questions before, but none of them gave a solution: 1. Showing a Windows context menu for multiple items 2. Display file properties dialog for files

How does implementing multiple COM interfaces work in C++?

为君一笑 提交于 2021-02-05 05:00:30
问题 I am trying to understand this example code regarding Browser Helper Objects. Inside, the author implements a single class which exposes multiple interfaces (IObjectWithSite, IDispatch). His QueryInterface function performs the following: if(riid == IID_IUnknown) *ppv = static_cast<BHO*>(this); else if(riid == IID_IObjectWithSite) *ppv = static_cast<IObjectWithSite*>(this); else if (riid == IID_IDispatch) *ppv = static_cast<IDispatch*>(this); I have learned that from a C perspective,

Check COM Interface still alive?

▼魔方 西西 提交于 2021-02-04 22:12:10
问题 In COM how does one verify that a pointer to a COM object still has a valid object on the other end? I have an issue where this following bit of code attempts to check if the m_pServer pointer is still alive, however when that application exposing that interface is killed this bit of code crashes the application. Can anybody advice on how to check the pointer before using it? if (FAILED(m_pServer->StillAlive())) { // do something } This code fails if m_pServer is no longer in memory. EDIT:

Calling A COM Component From .NET Windows Service

百般思念 提交于 2021-02-04 16:08:43
问题 I have a Windows Service written in .NET C# which calls a COM component. I also have a .NET Windows Forms test app which I was using to test the COM component. It works fine from the test app. However, when I use the same code in the Windows Service nothing happens. The COM components logs everything to file and the fact the log file doesn't get produced hints that the COM component isn't even being called. Why does this work from my test app but not within the windows service? 回答1: Service

How to get the method signatures for DShellFolderViewEvents

自闭症网瘾萝莉.ら 提交于 2021-01-29 21:56:09
问题 I'm trying to sink DShellFolderViewEvents using the ATL, and the only method I've been able to successfully subscribe to is DISPID_SELECTIONCHANGED . There appear to be many other events listed in the header shdispid.h , but I can't get them to fire. Not sure what I'm doing wrong (it might be ATL-related), but I thought perhaps I'm implementing event-handler functions with the wrong signatures (currently I'm just trying void functions with no arguments). The problem is that there doesn't

Register a 32-bit COM class for use in 64-bit Python without Administrator rights

女生的网名这么多〃 提交于 2021-01-29 19:38:24
问题 I'm making a Python script that uses SAP's GUI scripting API through win32com. The first usage is like this: from win32com.client import Dispatch objWrapper = Dispatch("SapROTWr.SapROTWrapper") This works fine when using a 32-bit Python interpreter, but not when using a 64-bit interpreter, which gives me a "Class not registered" error. Is there any way to do this, specially without Administrator privileges? The default answer will probably be something like "A 64-bit process can't load a 32

“Could not load file or assembly” Error Com-Enabled .Net Assembly

情到浓时终转凉″ 提交于 2021-01-29 17:41:58
问题 Currently, I am stuck with a classic asp project, that needs to call a .Net Assembly. It was working, until the customer had to wipe their server. I was able to reregister the .Net Assembly, but I get this error during runtime: MyDll error '80070002' Could not load file or assembly 'Newtonsoft.Json, Version=4.5.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The system cannot find the file specified. Here is the asp code, not sure if it will help. set Inst =

Trying to reverse ObjPtr to an Object I'm getting kernel not found error 53 in 64 bits but not in 32 bits

拟墨画扇 提交于 2021-01-29 11:47:54
问题 I'm referring Parent class from Child class; instead of simply do, for example: Public Property Set Parent(obj As ClassProperties) Set this.ParentColl = obj End Property I rather prefer to avoid references to and from getting entangled and 'out of memory' error when I loop through and create instances of the class so I use this that is based on that. It functions as a charm in 32 bits but at 64 bits I'm getting Runtime error '53' File not found: kernel. In a module: #If VBA7 Then Private

HRESULT:0x80040154 COM object with CLSID {} is either not valid or not registered

泄露秘密 提交于 2021-01-29 05:38:24
问题 I am using COM Object in my C# .NET 1.1 application. When the COM object is not registered on client machine, I get the exception: "COM object with CLSID {} is either not valid or not registered." (HRESULT:0x80040154) I know how to register the COM object using regsvr32. Our requirement is to identify the COM object which is not registered. We don't want to hardcode the name of the COM Object, rather identify it dynamically using the COM Exception/HResult. Any ideas? 回答1: Given the situation