com

Chaining methods of ATL/COM objects

本小妞迷上赌 提交于 2019-12-13 04:30:29
问题 In c++ we can easily set up method chaining in a class by designing methods returning *this. Would this be possible in an ATL/COM setting ? Let's say I have a simple ATL class MyOBj. I would like to know if chaining is possible in this context, and if so, what would be the idl signature of the method that would support chaining ? Simple examples would be appreciated ! (In fact, my methods are called from VBA for excel, and I would like to have chaining in that VBA context, as we have chaining

Do I need to force the GAC to reload an assembly? Is this possible?

ぐ巨炮叔叔 提交于 2019-12-13 04:12:50
问题 I've added types to my .NET classes that I'm using for COM interop. To get it to work with my VB6 application, I unregistered the DLL and re-registered it (using regasm ). I then uninstalled and reinstalled it to the GAC (using gacutil ). The types are showing up in the VB6 object explorer, but when I run the application in the VB6 IDE, it breaks on the line that instantiates the new types with the error: Automation Errror - The System cannot find the file specified . I thought this odd since

How to fire property changed notifications from C# to COM using IPropertyNotifySink?

青春壹個敷衍的年華 提交于 2019-12-13 04:07:36
问题 I am going crazy on this problem for the past couple of weeks. I have a C# Com object that needs to send property change notifications to a C++ Com object. An equivalent in VB would be using code that looks as follows PropertyChanged "propertyName". In C++ the equivalent to use the CFirePropNotifyEvent class from ATL. The C++ COM and VB COM objects do not implement a specialized events interface, so the equivalent are give above.. The C++ COM object that needs to sink the event is based

In ICollectionOnSTLImpl implementation, can't access m_T or item object's members

寵の児 提交于 2019-12-13 03:58:34
问题 I'm trying to implement a collections of objects via VC6 that can be accessed by a VB6 programs. I haven't been able to make it come together. I have defined _CopyVariantFromAdaptItf and _CopyItfFromAdaptItf (from "ATL internals"). Here are my defines to be used in my collections definitions: #define CComEnumVariantOnListOfItemInterface(ItemInterface) \ CComEnumOnSTL<IEnumVARIANT, &IID_IEnumVARIANT, VARIANT,_CopyVariantFromAdaptItf<ItemInterface>,vector< CAdapt< CComPtr<ItemInterface> > > >

activex can't create object by vbs but can by classic asp

我们两清 提交于 2019-12-13 03:43:20
问题 On my Windows Server 2008 R2 I installed a COM object and can create it from a classic ASP page. When I call it from a vbscript file, I get the "can't create" message. I have tried starting Powershell as administrator and using that to run the script. No luck. I have tried giving the "everyone" user full control over the COM DLL. No luck. Any ideas? 回答1: The only thing that makes sense to me is that the COM object is the same bit-ness as the class ASP and a different bit-ness than the script

COM: If I change the parent of an Interface do I need to create a new Interface?

走远了吗. 提交于 2019-12-13 02:59:16
问题 I have been adding new functionality to a COM Interface, and from what I have read the only way to do it( and keep it backwards compatible ) is to create a new interface that inherits the old interface and add the new methods. I have tried doing this but my hierarchy is already quite complex. Say this is how my interfaces currently are: IBaseInterface | IDerivedInterface and I want to add some functionality to the Base Interface, and it now looks like this: IBaseOldInterface | IBaseInterface

c# COM Objects issue

牧云@^-^@ 提交于 2019-12-13 02:38:18
问题 Background I am working on a trading ActiveX API in visual studio 2010 on C#. Since it is an ActiveX API, I simply added the ActiveX as my reference. The api provides three group of things: Method you could use to call API, the Event with which the API updates information for you and some socalled ActiveX COM object. ISSUE I asked a related question here: C# boolean int conversion issue Finally, after viewing the exception has been thrown, I know that it is about casting. Here is the

Is that possible to provide javascript API to control USB, LPT, COM devices?

点点圈 提交于 2019-12-13 02:27:50
问题 I have a computer running windows and connected with many devices, such as printer, RFID reader, etc. I want all my apps run as HTML, CSS, Javascript, so I need to access these devices through Javascript. But I don't know if it is possible to add custom Javascript API to browser (such as IE or Firefox), or what work are needed to make this possible. Thanks 回答1: You can use a browser's basic printing abilities to control a printer and may be able to find a keyboard wedge RFID reader, both of

Excel Sparklines not exported to PDF when using COM Automation

我怕爱的太早我们不能终老 提交于 2019-12-13 02:13:08
问题 I am having a problem programmatically exporting Excel sheets that contain sparklines to PDF format. When I manually export the Excel sheet to PDF format using Excel 2010's native PDF Exporting facility then everything works fine, but the moment I do it using simple COM automation then everything is exported to PDF with the exception of cells containing sparklines. The weird thing is that when I add a few data bars to the excel sheet then the sparklines near the data bars are suddenly

WithEvents error sinking a COM event that comes from a .NET component

不打扰是莪最后的温柔 提交于 2019-12-13 01:07:15
问题 I am attempting to raise an event in .NET and have it picked up through COM by a VBA application. This answer has been quite helpful in getting my events to show up properly in the type library. On the VBA side, everything looks legit. I have an object variable declared "WithEvents" ,the IDE lets me add event handlers, and the compiler doesn't complain. However at run-time, when I use New to create the object I get the Run-time error 459: This component doesn't support this set of events.