com

ComVisible in C++/CLI

故事扮演 提交于 2019-12-09 12:04:50
问题 i'm converting C++ to C++/CLI and would like to expose some managed classes as COM objects. In C# it was easy and setting [ComVisible] & inheriting from interface (also ComVisible) did the job. However C++ project build as C++/CLI does not export DllRegisterServer. Here is sample project (started from CLR Console Application project in VS 2008). #include "stdafx.h" using namespace System; using namespace System::Runtime::InteropServices; [ComVisible(true)] [Guid("E3CF8A18-E4A0-4bc3-894E

Given a COM DLL, extract all classes CLSID and corresponding interface name

南笙酒味 提交于 2019-12-09 11:34:37
问题 My question is similar to Getting CLSID for a DLL file?, I think. I have a directory with some DLLs, each one implementing one or more COM interfaces. I would like to get: 1) Each interface name 2) The CLSID of the class implementing the interface For each DLL. It's important that everything can be done programatically (So I can't use some sort of COM browser and manually look up for that information). Later I will lookup the CLSID given the interface name and call some methods using

How does COM registration work in Windows

点点圈 提交于 2019-12-09 11:08:31
问题 I'm an application packager trying to make sense of how the COM registry keys (SelfReg) interrelate to the given .dll in Windows. ProgID's, AppID's, TypeLibs, Extensions & Verbs are all tied around the CLSID right? Do CLSID's always use Prog/App IDs or could you just have a file extension class? Which bits are optional? Some of it seems to be 'like a router' where there's the two interfaces (internal - .dll) and external (the extension etc). How does this all fit? (The SDK documentation doesn

Access COM vtable from C#

和自甴很熟 提交于 2019-12-09 11:04:15
问题 Is there any way in C# to access a COM object's virtual method table in order to get a function's address? 回答1: After a lot of searching and piecing together different partial solutions, I figured out how to do it. First you need to define the COM coclass for the object you're trying to access: [ComImport, Guid("..."), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] internal interface ISomeCOMInterface { // Define interface methods here, using PInvoke conversion between types } Next you

How to mark .NET objects exposed to COM-interop as single threaded?

你。 提交于 2019-12-09 10:51:45
问题 When defining a COM-visible class in C++ I can define the supported threading model in the header file (the threading(single) line): [ coclass, default(IComInterface), threading(single), vi_progid("Example.ComClass"), progid("Example.ComClass.1"), version(1.0), uuid("72861DF5-4C77-43ec-A4DC-ED04396F0CCD") ] Is there a comparable way of setting the threading model in .NET (for example an attribute)? I currently define my COM-class as such: [Guid("67155A91-2948-43f5-B07F-5C55CDD240E5")]

COM Interop: What should I do to make a C# property usable as a VARIANT from VBA

我只是一个虾纸丫 提交于 2019-12-09 10:18:43
问题 Say I have a C# Nullable DateTime? property that needs to be consumed by VBA through COM. public DateTime? TestDate { get ; set; } Unfortunately, Nullables are not visible through COM, so I would like to have the property return a something that will be seen as a Variant from VBA. Unfortunately, I'm not sure how this should be written. I tried using an object and a dynamic instead of DateTime? : while I can get the property value, I can't set it (I get Run-Time error '424' Object required

Delphi plugin framework

妖精的绣舞 提交于 2019-12-09 09:18:23
问题 I want to design Delphi plugin framework. There are three options: 1. DLL 2. BPL 3. COM interface Every option has some disadvantage. DLL - Promblem with MDI apllication, forms from plugin cannot be embeded to the host exe - mdi application. BPL - Every *.bpl plugin and *.exe host application must be compiled with the same version of Delphi. COM - Interfaces {xxx-xx-xxx-xx} must be registered in system, (regsvr) So plugin framework cannot be portable! Is everything true what I wrote above? If

How to distinguish different types of NaN float in Python

天大地大妈咪最大 提交于 2019-12-09 09:15:49
问题 I'm writing Python 2.6 code that interfaces with NI TestStand 4.2 via COM in Windows. I want to make a "NAN" value for a variable, but if I pass it float('nan') , TestStand displays it as IND . Apparently TestStand distinguishes between floating point "IND" and "NAN" values. According to TestStand help: IND corresponds to Signaling NaN in Visual C++, while NAN corresponds to QuietNaN That implies that Python's float('nan') is effectively a Signaling NaN when passed through COM. However, from

Directshow in C# for windows mobile- strategy?

流过昼夜 提交于 2019-12-09 07:41:31
I'm trying to figure out how to add some directshow capabilities to a C# application (.net cf 3.5 running on mobile 6 and up), and I'm having a hard time figuring out how to bridge the gap between using unmanaged c++ class(es) in managed C#. I've already written the functionality I need in C++: Basically, I have a manager class that uses COM to tap into the needed directshow functionality. Quick Disclaimer: I'm new to COM, and I'm VERY new to integrating C++ with C#. I'm really hoping that someone knowledgeable can suggest a basic strategy for me to research further. Here are some that I've

tlbimp.exe converts HWND to _RemotableHandle

試著忘記壹切 提交于 2019-12-09 04:24:28
Our COM component interface has the next method: HRESULT CreatePluginWindow([in] HWND hParent, [in] RECT* prcView); We are going to use it in .NET application but interop for this interface is looking like this: void CreatePluginWindow(ref interop.alfrontx._RemotableHandle hParent, ref interop.alfrontx.tagRECT prcView) According my investigation there is no way to use this method without unsafe code. I'd not like to change COM interface in order to use other than HWND type for hParent, because it's used in many C++ components. I'd not like to make changes in interop because they are compiled