com

.Net to COM Interop Tester

五迷三道 提交于 2019-12-11 06:31:33
问题 I made a class in C# that I am exposing to COM. I can register it just fine using RegAsm.exe. I would like to test it before I send it off, but using TlbImp.exe gives me an error of "Type libaray was exported from a CLR assembly and cannot be re-imported as a CLR assemply." What is a good way to test this? 回答1: You can create a VB macros in word\excel\etc: Dim obj As Object Set obj = CreateObject("progid here") Call obj.SomeMethodForTest() 回答2: Use PowerShell: $myObj = new-object -comObject

How can I add a COM dll reference in my .net core project based on beta8?

你说的曾经没有我的故事 提交于 2019-12-11 06:27:55
问题 We have a .net core web project based on version dnx 1.0.0-beta8. I am trying to reference a COM dll which I have to register on the computer through regsvr32. Does .net core projects allow to reference com dlls. 回答1: To the best of my knowledge all currently released versions of .NET Core (1.1 and below) and .Net Standard (1.6 and below) do not have a way to add Com refrences due to the fact that .NET Core is designed to be multi-platform and COM is a windows specific feature. I do not know

COM co-class per-user registration

那年仲夏 提交于 2019-12-11 06:27:52
问题 Need to implement per-user registration of a COM co-class by adding registry entries to the HKCU registry hive (XP SP3, Windows 7, Windows 8). What is the minimal set of required registry entries to create an object instance by calling the VBScript CreateObject function? UPD: VBScript implementation Sub RegisterComObject(Path, ProgId, ClsId) Dim Shell Set Shell = WScript.CreateObject("WScript.Shell") Shell.RegWrite "HKCU\Software\Classes\" & ProgId & "\", "" Shell.RegWrite "HKCU\Software

How do I do COM Interop in Java?

江枫思渺然 提交于 2019-12-11 06:25:29
问题 I am a .NET programmer working with a Java Spring Boot project to create a REST API. I need to do some COM interop with an Excel spreadsheet from within the Spring Boot application. How do I go about doing that? I know the code to write. I just don't know the tools. Specifically, what jar files do I need to reference? Where do I get them from? 回答1: I would prefer https://poi.apache.org/ Otherwise you can use "Java Access Bridge", here is an overview https://docs.oracle.com/javase/8/docs

packaging a COM addin for deployment

穿精又带淫゛_ 提交于 2019-12-11 06:24:24
问题 Good Day All, I am unfamiliar with the proper techniques for packaging a windows installer for my COM level addin (This is the higher level version which registers a COM server [implements the ID2Extesibility interface] and can be distributed to all office products at once [word, excel, etc]). I am using VS2010 and am attempting to get the addin to work on a customer's computer. I believe that I have figured out the problem is within the COM registration itself. It seems that the installer

Anyone got C# source for Running Object Table viewer?

倖福魔咒の 提交于 2019-12-11 05:55:47
问题 Answering my own question here. The Running Object Table (ROT) is a Microsoft Component Object Model (COM) artefact where Excel and Word documents can register themselves to make them accessible to any other application on a machine. The ROT thus faciliatates Object Embedding and Linking (OLE) and Interprocess Communication (IPC). There used to be a program called ROTViewer.exe that dates from the Visual Basic 6 era which allowed a developer to eyeball the ROT's contents. Surprisingly, no-one

Why can't I browse dll to figure what's in it?: “Some components could not be browsed”

瘦欲@ 提交于 2019-12-11 05:52:40
问题 I'm looking for a missing COM interface X which I suspect is defined in Y.dll . I can peek at this presumptive interface using grep X Y.dll which says "matches". Hurrah, suspicion confirmed! Alas, when I use the Object Browser in Visual Studio Express, trying to add Y.dll to my Custom Component Set, I get the error: "Some components could not be browsed" in a pop-up window. So what are the reasons I can't browse this dll? Can the COM interfaces deliberately or accidentally be protected,

Error when accessing a COM dll with Threading Model Apartment from Multithread Apartment

我与影子孤独终老i 提交于 2019-12-11 05:52:07
问题 I have to communicate with a third party application and the only way to do so is by accessing the provided COM component. Because the interaction takes about 3 minutes it's mandatory that it takes place in the background. So what i tried to do is to add a reference the component with option "embedd interop-types" = true and to create a test that reads very basic data through the interface. The documented way to do so is by following Code: System sys = new System(); if(Convert.ToBoolean(sys

Exception: Invalid object array with comtypes

不羁岁月 提交于 2019-12-11 05:46:46
问题 I try to implement a simple copy operation between two Autocad documents via COM in Python. from pyautocad import Autocad, APoint from comtypes.client import GetBestInterface # Get acad application acad = Autocad(create_if_not_exists=True) # Create a new document doc1 = GetBestInterface(acad.Application.Documents.Add()) # add a circle in this document and make it visible circle = GetBestInterface(doc1.ModelSpace.AddCircle(APoint(0.0, 0.0), 1.0)) doc1.Application.ZoomExtents() # create another

C++ (ATL) ITypeInfo.GetContainingTypeLib fails when passed live instance of VBA Class

霸气de小男生 提交于 2019-12-11 05:44:56
问题 So I asked this question in a C# context and I have set bounty over there. I have written an equivalent fragment of C++ code (to be housed within an ATL DLL project) to tap C++ developers experience as well. IDispatch has a method called GetTypeInfo() with which one can acquire a pointer to ITypeInfo. ITypeInfo itself has a method called GetContainingTypeLib which gets the containing ITypeLib (as it says). This is useful when given a CoClass instance once can get to all the other CoClasses in