com

Strange Case of the missing method: SXS and Controls.Add results in “object doesn't support this property or method”?

六眼飞鱼酱① 提交于 2019-12-06 04:12:02
问题 I have a project written in VB6 that uses a UserControl, The project runs fine when the OCX is registered, but if I run the same project with a side by side manifest it results in an error. I can use the Control with no problem as long as it's loaded statically (added before on the form) but if I add a dynamic control to form on any use of the new control (property or method) I get this error: Object doesn't support this property or method This error can be reproduced this way: Create an OCX

IPreviewHandler throws uncatchable exception

点点圈 提交于 2019-12-06 04:09:59
I've imported the COM interface IPreviewHandler into a WinForms app and am using it to display previews for various types of documents (I look up the GUID of the appropriate preview handler in the registry, then use Activator.CreateInstance(guid) to instantiate the specific COM class. This works wonderfully for the vast majority of file types - Office formats, PDFs, videos, etc - however, after I instantiate the "Microsoft Windows TXT Preview Handler" {1531d583-8375-4d3f-b5fb-d23bbd169f22} , initialise it with a stream containing an ordinary .txt file, set the bounds of the preview window and

Matlab : running a function in a COM server without blocking matlab?

微笑、不失礼 提交于 2019-12-06 04:07:14
I'm working on Matlab 64-bits R2011b, and I have to use a 32-bits version (I have R2010b installed) to command a hardware (32-bit dll). For that, I created a COM server with actxserver() and it works. However, whenever a function takes time in the 32-bit session, the 64-bit session becomes 'busy' and nothing works anymore until completion. I simplified my problem in the script below : if you have two Matlab versions installed, you can try my code and see my problem. In a few words : one button starts a timer that simply shows the time elapsed since it was started the other button makes a 2

Building a COM object vtable in x86 assembly

夙愿已清 提交于 2019-12-06 04:04:28
问题 I am building a COM object in x86 assembly using NASM. I understand COM quite well and I understand x86 assembly pretty well, but getting the two to mesh is getting me hung up... (by the way, if you're thinking of attempting to dissuade me from using x86 assembly, please refrain, I have very particular reasons why I'm building this in x86 assembly!) I am trying to build a vtable to use in my COM object, but I keep getting strange pointers, rather than actual pointers to my functions. (I'm

How do I access the classic Internet Explorer COM automation object for a running instance of Internet Explorer from Powershell?

故事扮演 提交于 2019-12-06 03:48:21
How do I access the classic Internet Explorer COM automation object for a running instance of Internet Explorer? That is, if I have Internet Explorer open in multiple windows, how do I associate the COM object corresponding to one of those windows with a variable in Powershell, from within Powershell? The closest I have come to doing this is obtaining the processes "iexplore" and "ieuser" via get-process. Usually, to obtain access to a COM interface on an existing object, you would use the running object table. Unfortunately, Internet Explorer doesn't register itself with the running object

How to copy excel worksheets Into another excel workbook without opening the excel file in c# winforms?

丶灬走出姿态 提交于 2019-12-06 03:45:58
问题 In C# windows application, I have many excel workbooks, what i want is to copy the worksheets from the excel workbook to a single workbook. This is possible, but i have to open the excel workbooks in order to do so. Excel.Application app = new Excel.Application(); app.Visible = true; app.WindowState = XlWindowState.xlMinimized; app.Workbooks.Add(""); app.Workbooks.Add(@"Path\WorkBook1.xlsx"); app.Workbooks.Add(@"Path\WorkBook2.xlsx"); for (int i = 2; i <= app.Workbooks.Count; i++) { int count

How do I handle a string array returned from a C# Method in VBA

房东的猫 提交于 2019-12-06 03:44:55
I have written an assembly in C# which returns a string array, the C# code is below: [ComVisible(true)] public class PostcodeFinder { public string[] SearchPostcodes(string postCode) { var searchService = new QuickAddress("http://x.x.x.x:xxxx/") {Engine = QuickAddress.EngineTypes.Singleline, Flatten = true}; var mPicklist = searchService.Search("GBR", postCode, PromptSet.Types.OneLine); var x = mPicklist.Picklist.Items.Count(); var resultsToReturn = new string[x]; for (var i = 0; i < x; i++) { resultsToReturn[i] = mPicklist.Picklist.Items[i].PartialAddress; } return resultsToReturn; } } I have

Why do IUnknown* pointers retrieved through different interfaces of the same COM object have the same value?

人走茶凉 提交于 2019-12-06 03:38:38
I have the following hierarchy of COM interfaces and a class implementing them: interface IX : public IUnknown{}; interface IY : public IUnknown{}; class CA: public IX, public IY{}; Here class CA effectively inherits from IUnknown twice. We know there are two vtable pointers in class CA - one is pointed to IX and another is pointed to IY . So IUnknown stored in the IX subobject is different from IUnknown stored in the IY subobject. Yet when we call IX::QueryInterface() or IY::QueryInterface() on the same object and query IUnknown we get identical IUnknown* pointers. Why does it happen?

Is this .tlh file correct, and if not, then how do I generate the correct one?

点点圈 提交于 2019-12-06 03:35:17
I am trying to call a .NET 4.0 dll from unmanaged C++ code. I followed the instructions in this Code Project article by Atul Mani. I built the .NET dll, and followed all the steps up to and including registering it with regasm. Next, I created an unmanaged C++ project and added this line at the start of the .cpp file: #import "D:\PathToMyCSharpProject\bin\Debug\com.DeviceServices.tlb" rename ("EOF","adoEOF") no_namespace named_guids raw_interfaces_only When I built the C++ project, a .tlh file was created in D:\MyCPlusPlusProject\Debug. Next, I added the code suggested by the CodeProject

COM interop side-by-side assemblies

假装没事ソ 提交于 2019-12-06 03:17:31
问题 I need to deploy multiple versions of the same C# .NET project. The project output is a COM interop assembly to be used in a native application. The problem I'm having is that I have to deploy several versions of this assembly side-by-side but whatever I do doesn't seem to create different versions. Instead the versions override eachother. I've tried changing the assembly GUID, tried changing the assembly version numbers, tried regenerating the assembly strong name key, tried changing the