com

COM Client/Server cross 64/32 bit processes

空扰寡人 提交于 2019-12-23 14:24:13
问题 On a 64-bit machine: Can a 64-bit application call a COM server (out proc) which is running in 32-bit process? What about vice versa? (32 bit app calling 64-bit COM out proc server) Thanks! 回答1: The whole point of out-proc COM is that the two processes interact via RPC (usually LRPC), so it doesn't matter at all which bitness each of them has. We used COM+ surrogate for forcing 32-bit in-proc components into a separate process for the only purpose of consuming them from 64-bit clients many

Registered COM object not recognized by python's win32com.client.dispatch()

无人久伴 提交于 2019-12-23 13:07:03
问题 I'm trying to load a COM object with Python. I'm using win32com.client.Dispatch("Name.Of.Object") to load it, and the COM object has been registered with regsvr32 and appears as an entry in my registry in both HKLM/CLSID and HKLM/Wow6432Node/CLSID. I can open it using VBScript just fine, but Python's win32com.client.Dispatch() gives me this error: Traceback (most recent call last): File "<stdin>", line 1, in <module> File "C:\Python27\lib\site-packages\win32com\client\__init__.py", line 95,

C++ COM design. Composition vs multiple inheritance

佐手、 提交于 2019-12-23 13:03:05
问题 I'm trying to embed a browser control in my application (IWebBrowser2). I need to implement IDispatch, IDocHostShowUI, IDocHostUIHandler etc to make this work. I am doing this in pure C++/Win32 api. I'm not using ATL, MFC or any other framework. I have a main class, called TWebf, that creates a Win32 window to put the browser control in and makes all the OLE calls needed to make it work. It's also used for controlling the browser control, with methods like Refresh(), Back(), Forward() etc.

DirectShow cast sampleGrabber to ISampleGrabber

℡╲_俬逩灬. 提交于 2019-12-23 13:00:00
问题 I have a strange error that I cannot wrap my head around. I have a graph created in a separate thread that runs and I'm trying to access the IBaseFilter sampleGrabber outside the thread which worked in a console application but I moved the code to a new project and where I'm trying to cast sampleGrabber to ISampleGrabber the runtime complains with a null reference exception. If I debug sampleGrabber it does have the interface ISampleGrabber however I cannot cast it anymore. Moving the code

Use .NET COM in vb6

落花浮王杯 提交于 2019-12-23 12:50:03
问题 Im having trouble using a .NET COM in vb6, It compiles ok and I use regasm to register it, add a reference to it in the vb6 project, it even has intellisense. But when I try to make make an instance it gives me an 'Automation Error'. Any one can help? Thanks in advance. 回答1: You probably need to make sure your .NET assemblies are in the VB6 application's directory, or if debugging in the VB6 IDE that they are in the VB6.exe's directory. It is possible to make COM interop with .NET assemblies

Using std::unique_ptr for managing COM objects

萝らか妹 提交于 2019-12-23 12:39:02
问题 I'm trying to use smart pointers to hold COM objects in my class while avoiding ComPtr. Is it possible to use unique_ptr for this purpose? I'm quite new to smart pointers and so far I'm a bit confused. Please consider the following simplified code: class Texture { private: struct ComDeleter { operator() (IUnknown* p) { p.Release(); delete p; } } ID3D11Texture* m_dumbTexture; std::unique_ptr<ID3D11Texture, ComDeleter> m_smartTexture; public: ID3D11Texture* getDumbTexture() const { return m

How can I tell what module my code is executing in?

不羁的心 提交于 2019-12-23 12:17:36
问题 For a very long time, when I have an error handler I make it report what Project, Module, and Procedure the error was thrown in. I have always accomplished this by simply storing their name via constants. I know that in a Class you get the name programmatically with TypeName(Me), but obviously that only gets me one out of three pieces of information and only when I'm not in a "Standard" module. I don't have a really huge problem with using constants, it's just that people don't always keep

Getting IDL (for TLB) from a COM+ dll when it is not provided

假装没事ソ 提交于 2019-12-23 11:49:35
问题 I have a .dll that contains some directshow filters (COM) with specific/custom interfaces to query. Most 3rd party directshow components contain embedded .tlb files that can be used for cross-enviroment communication (C# typelib import). I would hate to have to attempt to manually create the interfaces needed for c# because no idl/tlb files were provided. Is it possible to generate a tlb (or at least, an idl, which I can MIDL compile) from a COM .dll? 回答1: Yes, it is possible to reverse

Can my 32 bit and 64 bit COM components co-reside on the same machine?

穿精又带淫゛_ 提交于 2019-12-23 11:47:53
问题 I have a 32 bit COM component that is used mostly by ASP, we also have the 64 bit version. The 64 bit version is functionally identical and it also uses the same ProgID (and as far as I know the same CLSID's etc). Can I install/regsvr the 64 bit version on the same machine as the 32 bit version (obviously in a different folder) and have my existing 32 bit applications continue to use the 32 bit component, whilst my 64 bit applications consume the 64 bit version? These are native code

Can my 32 bit and 64 bit COM components co-reside on the same machine?

这一生的挚爱 提交于 2019-12-23 11:47:06
问题 I have a 32 bit COM component that is used mostly by ASP, we also have the 64 bit version. The 64 bit version is functionally identical and it also uses the same ProgID (and as far as I know the same CLSID's etc). Can I install/regsvr the 64 bit version on the same machine as the 32 bit version (obviously in a different folder) and have my existing 32 bit applications continue to use the 32 bit component, whilst my 64 bit applications consume the 64 bit version? These are native code