com

Calling Managed C# COM Objects from C#

和自甴很熟 提交于 2019-12-01 11:02:31
I am trying to call a C# COM object from C#. I created a class library in C# and exported a Type Library using tlbexe.exe. I then registered the type library using regtlibv12.exe. However when I add a reference to my COM object in Visual Studio I get an error saying: "The Active X type library ... was exported from a .NET assembly and cannot be added as a reference. Add a reference to the .NET assembly instead." Any assistance would be greatly appreciated. A 64bit process cannot access the 32bit unmanage code directly. There are 2 domains for COM objects on a 64bit system. One for 64bit

Need of ClassInterfaceType.None?

孤街浪徒 提交于 2019-12-01 10:54:22
Didn't quite get the following from MSDN : ClassInterfaceType.None Indicates that no class interface is generated for the class. If no interfaces are implemented explicitly, the class can only provide late-bound access through the IDispatch interface. This is the recommended setting for ClassInterfaceAttribute . Using ClassInterfaceType.None is the only way to expose functionality through interfaces implemented explicitly by the class. Is [ComVisible(true)] a must for COM visibility? See this blog post for the expanation of the first problem. The point is that unless you specify

Raising events in a class library exposed to COM

半腔热情 提交于 2019-12-01 10:38:02
问题 I'm trying to write a wrapper to a service, which will be used by an existing VB6 project. I've got most of the basic framework working, except for one important aspect: I can reference the wrapper in a VB6 project and subs/function calls etc. work as expected, but events do not. The events are visible in the VB6 app, but they never fire. VB.NET Code: Public Event Action_Response(ByVal Status as String) Public Function TestEvent() RaiseEvent Action_Response("Test Done") Return "Done" End

Why would Windows Search query my IFilter for a bunch of weird interfaces?

旧巷老猫 提交于 2019-12-01 10:35:36
I've implemented an IFilter as a native VC++ ATL in-proc COM server. Windows Search wouldn't use it - it creates an instance of my IFilter and then executes a bunch of QueryInterface() calls, specifically: IMarshal IStdMarshalInfo something with {4C1E39E1-E3E3-4296-AA86-EC938D896E92} interface id and a couple of others. Since my IFilter only implements IFilter, IPersist and IPersistFile most of the calls return E_NOINTERFACE, so Windows Search just releases my object and does nothing. Why is it querying for those interfaces and how do I work the problem around? Shay Erlichmen Windows tries

Connect 64bit Java with 32bit COM dll using Com4j or Jacob

◇◆丶佛笑我妖孽 提交于 2019-12-01 10:34:16
I have the following configuration: 1) Windows 10 64-bit 2) An application that has only a 32-bit version and is available through COM. I access the .dll file of the 32-bit application using the tlbimb.jar to generate the interfaces needed and I succeed. Scenario 1: I try to access the 32-bit application using the Java 8 32-bit installation. I can invoke the methods through COM succesfully without any problem. Scenario 2: I try to access the 32-bit application using a Java 8 64-bit installation. I get an error message: Exception in thread "main" com4j.ExecutionException: com4j.ComException:

passing an array of structs from c# to C++ using com callable wrapper

六月ゝ 毕业季﹏ 提交于 2019-12-01 10:08:19
问题 Consider the code below that is meant to be accessed by C++ using com namespace MarshalLib { //define an interface for account services [ComVisible(true)] [Guid("39B8A693-79BB-4638-92DE-245A88720953")] public interface IAccountStructLookup { AccountStruct RetrieveAccount(int acctId); void UpdateBalance(ref AccountStruct account); Alias[] GetRef(); } //Implement an account struct [ComVisible(true)] [Guid("DB48C5B6-9646-491A-B030-C0CADCFC03E0")] public struct AccountStruct { public int

pyvot: can I run Excel VBA macros from python script?

情到浓时终转凉″ 提交于 2019-12-01 09:54:01
问题 Say I have loaded Report WW26blueprint_with_chart_330.xlsm in the report object with the following code (the print.range is used here to test that the workbook is loaded): import xl report = xl.Workbook("Report WW26blueprint_with_chart_330.xlsm") print report print(report.range("A1:E50").get()) From the pyvot documentation I get that: Pyvot is written on top of Excel’s COM API. You can always get the underlying COM object and make COM calls yourself My Excel file has the following macros:

How to get the PIDL of an open explorer window?

佐手、 提交于 2019-12-01 09:22:13
I know how to get all open explorer windows , using Microsoft Internet Controls COM library. From this, I am able to find the LocationURL of those windows. However, this is only set for paths on the file system. Seemingly when virtual objects are displayed, like network printers or the recycle bin, LocationURL is empty. LocationName still seems to be set to the name which is visible on the start bar. When LocationURL is set, this is sufficient for my purposes to know where the explorer window is pointing to, but how can I find out what it is pointing to for these special folders? Reading up a

Need of ClassInterfaceType.None?

你离开我真会死。 提交于 2019-12-01 09:18:04
问题 Didn't quite get the following from MSDN: ClassInterfaceType.None Indicates that no class interface is generated for the class. If no interfaces are implemented explicitly, the class can only provide late-bound access through the IDispatch interface. This is the recommended setting for ClassInterfaceAttribute . Using ClassInterfaceType.None is the only way to expose functionality through interfaces implemented explicitly by the class. Is [ComVisible(true)] a must for COM visibility? 回答1: See

Is there any way to draw Webbrowser content to a specific DC?

馋奶兔 提交于 2019-12-01 09:16:35
问题 These days, I tries to create a hiden WebBrowser control in my program, and Using the IViewObject interface draw to my custom DC. The result is fine, I got All the content I want, but the Draw speed is unacceptable, especially some complex web pages which contains Flash objects, Each Draw to DC cost more than 100 ms . So the flash object I drew is not smooth. Is there a fast way to draw the control to my a specific DC? my code sinpet is like this: //hCompDc is a CompatibleDC which select a