com

How do I register a proxy/stub for a COM interface defined by a third party?

筅森魡賤 提交于 2019-12-08 04:53:19
There's Another Company that ships the product that consumes IAnotherCompanyInterface. We want to ship a COM object that implements IAnotherCompanyInterface. That interface is not Automation-compatible, so the next easiest option to enable marshalling is using a proxy/stub. Another Company doesn't ship the proxy/stub and doesn't want to. Compiling and registering the proxy/stub is not a problem by itself but consider the following situation. There's our company shipping a COM object implementing IAnotherCompanyInterface and the ThirdPartyCompany that does the same. So both components might end

PowerPoint 2007 SP2, ExportAsFixedFormat in PowerShell?

江枫思渺然 提交于 2019-12-08 04:40:59
问题 Yesterday I was trying to batch convert a group of PPTs into PDFs for a friend, and I decided to have a look at PowerShell, since it's been sitting on my HD for a while. Here's the code I've come up with. $p = new-object -comobject powerpoint.application # I actually don't know why I have to set the window to visible, # but it doesn't work otherwise, anyway, it's not the real problem I have $p.visible = 1 $f = $p.presentations.open('\some\file.ppt') $f.ExportAsFixedFormat('\some\newfile.pdf',

Internet Explorer Addon Toolbar Button Error

自古美人都是妖i 提交于 2019-12-08 04:32:00
问题 I am currently developing an IE toolbar button in C# that is supposed to be able to get the contents of the current tab and work with it. However, whenever the button is clicked, the IObjectWithSite.SetSite function is called ( my code will be posted at the end) and returns the following error: Unable to cast COM object of type 'System.__ComObject' to interface type SHDocVw.IWebBrowser2'. This operation failed because the QueryInterface call on the COM componenet for the interface with IID '

Passing pointer from managed C++/CLI to ActiveX C++ component

岁酱吖の 提交于 2019-12-08 04:31:56
问题 I have an ActiveX component built in C++. One of its methods has this signature: short Component::Method(short FAR* ptr) {} When the I add the ActiveX into my C++/CLI application the method signature shows as: short Compnenet::Method(short% ptr) {} I want to be able to correctly pass short* pSomething; variable value to this method. of course, the new signature doesn't accept passing arguments as short* and even if you try to cast to short% it doesn't give right results. Note: I don't have

C#/COM interop working only in debugger

时光毁灭记忆、已成空白 提交于 2019-12-08 04:21:52
问题 I have a problem with COM interop from a C# application to an inproc COM server component. I have reduced the problem to a simple c# test program. It instantiates the server component's interop class, sets the value of a string a property on the instance, and then sets another string property. I'm not doing anything unusual with marshalling. Just using the interop class generated when I added a reference to the COM component. Something like: using MyLib; // Interop assy // ... MyComp comp =

Failing to read XML content using XmlSerializer

雨燕双飞 提交于 2019-12-08 04:02:43
问题 I got this in my class: namespace MSAToolsLibrary.PublisherEntry { [XmlRoot(ElementName = "PublisherDatabase", Namespace = "http://www.publictalksoftware.co.uk/msa")] public class PublisherData { public PublisherData() { //_Publishers = new List<Publisher>(); _PublishersDictionary = new Dictionary<string, Publisher>(); } public List<Publisher> Publishers { get { return _PublishersDictionary.Select(x => x.Value).ToList(); } set { _PublishersDictionary = value.ToDictionary(x => x.Name, x => x);

Excel workbooks.saveas() error in powershell

╄→尐↘猪︶ㄣ 提交于 2019-12-08 04:00:39
问题 I'm trying to convert .xls files to .xlxs I tried many variations of this code but every time i'm facing this error message : Exception lors de l'appel de « SaveAs » avec « 2 » argument(s) : « La méthode SaveAs de la classe Workbook a échoué. » Au caractère C:\temp\xlsx.ps1:18 : 6 try{$opendoc.saveas($basename, $saveFormat)} ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ CategoryInfo : NotSpecified: (:) [], MethodInvocationException FullyQualifiedErrorId : ComMethodTargetInvocation Here is my code :

How to get my IHttpNegotiate implementation called by IWebBrowser?

回眸只為那壹抹淺笑 提交于 2019-12-08 03:54:24
问题 I use cwebpage_src code and I need to update some HTTP request headers while clicking on links. As I understand it can be done with self implementation of IHttpNegotiate->BeginTransaction. But how to get my IHttpNegotiate implementation called?? Thanks! 回答1: Although I have no experience of writing one, I believe that you need to write an asynchronous pluggable protocol, as recommended in this thread. Details of how and why to do this are scattered around the web in various places, but the

Automating Saving a file from the web with the IE COM object in Powershell

走远了吗. 提交于 2019-12-08 03:54:24
问题 I'm using IE11's COM object in Powershell to authenticate to a website and pull down a list of orders. So far, my script is successfully sending the username and password as well as getting to the orders page and I can even "click" on the link that downloads the file I need. The problem is that instead of saving the file like I need to do the open/saveas dialog comes up and the script bombs. I've attempted to have IE11 automatically save the file by editing the registry and specifying the

Does it require to marshal the com object supporting threading model “Both”

≯℡__Kan透↙ 提交于 2019-12-08 03:32:46
问题 We are given in-proc-server (.dll) with threading model "Both".i noticed the threading model in registry editor.as we know com object created with "Both" will take the threading model of the thread in which the object is created. i instantiated the object in a STA thread to make sure call to com object should go through only one thread. i was invoking the methods of this objects from child thread in a serialized way where object is actually created in main(STA) thread will it make any side