com

How to create a parameter of type PSafeArray?

允我心安 提交于 2021-01-29 03:14:50
问题 How to create a parameter of type PSafeArray? I take the following error from C# COM library: SafeArray with range 65262 transfered to the method that requires array with range 1 Delphi XE2 should call C# COM library procedure using Generated RIDL type-library with a parameter of type PSafeArray. Delphi XE2 code: function GetObjects: PSafeArray; var aObjects: Variant; begin aObjects := VarArrayCreate([0, 2], varVariant); aObjects[0] := ADOConnection.ConnectionObject; aObjects[1] :=

Consuming EXE server through quasi Isolated COM

冷暖自知 提交于 2021-01-28 22:11:26
问题 I have been able to use manifests and especially the MSBuild task GenerateApplicationManifest so that our main application uses Isolated COM. I can create all the COM objects implemented in DLLs that I need without having to register the DLLs on my client machine. But, I'm greedy... Our application suite also has some separate applications that are invoked through COM, generally. For these, it is said that you can't do EXE to EXE isolated COM. Strictly speaking, that is true, but I have

Use -ComObject Word.application without install Word

和自甴很熟 提交于 2021-01-28 12:38:45
问题 I have a powershell script which use "-ComObject Word.Application". I would like to use this in a windows server but it doesn't have Word. For now, when i execute , i have this error. New-Object : La récupération de la fabrique de classes COM pour le composant avec le CLSID {00000000-0000-0000-0000-000000000000} a échoué en raison de l'erreur suivante: 80040154 Classe non enregistrée (Exception de HRESULT : 0x80040154 (REGDB_E_CLASSNOTREG)). Au caractère E:\BELAIRREC\Scripts\PowerShell

Use -ComObject Word.application without install Word

本秂侑毒 提交于 2021-01-28 12:35:00
问题 I have a powershell script which use "-ComObject Word.Application". I would like to use this in a windows server but it doesn't have Word. For now, when i execute , i have this error. New-Object : La récupération de la fabrique de classes COM pour le composant avec le CLSID {00000000-0000-0000-0000-000000000000} a échoué en raison de l'erreur suivante: 80040154 Classe non enregistrée (Exception de HRESULT : 0x80040154 (REGDB_E_CLASSNOTREG)). Au caractère E:\BELAIRREC\Scripts\PowerShell

How to implement advanced custom properties in VB6 usercontrols?

北城余情 提交于 2021-01-28 05:59:11
问题 Sorry I don't know how to name it other than "advanced custom properties". If I know, I would search it first. I am dealing with a legacy code using 3-rd party controls. In VB6, When you drag that control onto the form, you can see all the properties supported by the control in the "Properties" window. Such as MarginLeft, MarginRight etc. etc. That's no problem. In the "Property" window, the top-most property is generally the "(Name)" field, which is the name of the control. But the 3-rd

Where is IFileOperation implemented (and how can I verify this)?

↘锁芯ラ 提交于 2021-01-28 03:26:35
问题 I am trying to find out where IFileOperation is implemented in Windows 7. As far as I understand from the MSDN page it is in shell32.dll. So, I checked all the COM objects in shell32.dll using a DLL export viewer (from NirSoft) and IFileOperation is not one of them. I searched the registry for the CLSID_FileOperation {3ad05575-8857-4850-9277-11b85bdb8e09} and I found (as far as I understand) that it is in shell32.dll. But how can that be if I couldn't find that COM export using DLL export?

Python win32com - application installed with both 32bit and 64bit versions

心已入冬 提交于 2021-01-28 03:24:26
问题 I am using pythons win32com module to automate Adobe Photoshop. This works fine on some machines (have had issues with it not working on users with limited windows account permissions, but thats another issue). But on machines with both the 32bit and 64bit versions of Photoshop installed, I am getting errors when trying to access com objects, not the Photoshop.Application object itself, but Photoshop.PhotoshopSaveOptions, and Photoshop.SolidColor com objects. The error I get is Server

Using CoInitialize in a Delphi thread

半世苍凉 提交于 2021-01-27 23:16:19
问题 I am using TIdHttp and TXMLDocument inside a thread in a Delphi program. Now I want to know: Do these classes use COM objects so I need to call CoInitialize and CoUninitialize in this thread? If yes, do I have to use these functions at the body of execute method or at all methods that use TIdHttp or TXMLDocument classes? 回答1: TIdHTTP has no COM dependency. TXMLDocument can have a dependency on COM. On Windows, out of the box it is a wrapper around Microsoft's MSXML ActiveX component, which

How do I attach a debugger to other process than I start in Visual Studio 2017?

时光总嘲笑我的痴心妄想 提交于 2021-01-27 17:21:48
问题 An architecture which I have to deal with is quite complicated: a native C++ Windows Service creates an out-of-process COM object (native C++, CoCreateInstance with context = CLSCTX_LOCAL_SERVER) which dynamically loads (AfxLoadLibrary) my C# DLL. I would like to debug my DLL when I click Debug -> Start Debugging. I know that I can debug it when I attach to COM object process using Debug -> Attach to process and I can use System.Diagnostics.Debugger.Launch() in my DLL code if I need to debug

Get AdministratorsMembers SIDs in .NET CORE 2

谁说我不能喝 提交于 2021-01-27 14:14:28
问题 I wrote this function to retrieve all Administrators Members SIDs: private IList<byte[]> GetAdministratorsMembersSIDs() { IList<byte[]> adminMembers = new List<byte[]>(); SecurityIdentifier id = new SecurityIdentifier(administratorsSid); string name = id.Translate(typeof(NTAccount)).Value.Split('\\')[1]; using (DirectoryEntry adminGroupEntry = new DirectoryEntry(string.Format("WinNT://./{0},group", name))) { foreach (object member in (IEnumerable)adminGroupEntry.Invoke("Members")) { using