ole

Can Win32::OLE be used in parallel to start multiple instance of Matlab?

我与影子孤独终老i 提交于 2019-12-11 06:54:57
问题 When Parallel::Loops is combined with Win32::OLE to create multiple instance of Matlab, if we use my $ML = Win32::OLE->new('Matlab.Application') or die "Cannot start MATLAB" in each loop, the program crashes showing an unhandled exception. If drop the my before $ML then it works, but at any time only one instance is running. 回答1: I'm not sure what is the benefit of creating multiple MATLAB COM servers in a parallel loop. By default the server is created in shared mode, ie shared by all

Why do I need OleDbCommand.Prepare()?

若如初见. 提交于 2019-12-11 06:38:14
问题 I'm working with a datagrid and adapter that correspond with an MSAccess table through a stored query (named "UpdatePaid", 3 paramaters as shown below) like so: OleDbCommand odc = new OleDbCommand("UpdatePaid", connection); OleDbParameter param; odc.CommandType = CommandType.StoredProcedure; param = odc.Parameters.Add("v_iid", OleDbType.Double); param.SourceColumn = "I"; param.SourceVersion = DataRowVersion.Original; param = odc.Parameters.Add("v_pd", OleDbType.Boolean); param.SourceColumn =

Opening OLE Compound Documents read-only with StgOpenStorage

流过昼夜 提交于 2019-12-11 06:37:08
问题 I'm using the StgOpenStorage API under XP to read an OLE Compound Document, but I can't find the right mix of flags to tell Windows that I need just to read the file without blocking access to it to any other process... Right now I'm using STGM_READ | STGM_EXCLUSIVE but obviously if at the same time I try to open the file from another application, it complains about denied access.. So I tried with STGM_READ | STGM_SHARE_DENY_NONE but it complains about invalid flags.. Is there a way to do

COM co-class per-user registration

那年仲夏 提交于 2019-12-11 06:27:52
问题 Need to implement per-user registration of a COM co-class by adding registry entries to the HKCU registry hive (XP SP3, Windows 7, Windows 8). What is the minimal set of required registry entries to create an object instance by calling the VBScript CreateObject function? UPD: VBScript implementation Sub RegisterComObject(Path, ProgId, ClsId) Dim Shell Set Shell = WScript.CreateObject("WScript.Shell") Shell.RegWrite "HKCU\Software\Classes\" & ProgId & "\", "" Shell.RegWrite "HKCU\Software

Excel Copy-Paste from Delphi (OLE) with all the formatting?

[亡魂溺海] 提交于 2019-12-11 06:04:18
问题 I have Excel file (old *.xls format, but that should be irrelevant here) with very complex formatting and data: differently merged cells, cells/ranges with custom backgrounds, fonts and so on. And I am trying programmatically copy/paste rectangular region from on file to other. I am using Delphi (2009, but that should be irrelevant as well), I am using OLE code and Excel_TLB. I have the following code: procedure TMainForm.PrepareBtnClick(Sender: TObject); var OldFileName: string; OldApp:

SQL - Create XML - How to set Unicode UTF-8

人盡茶涼 提交于 2019-12-11 04:34:04
问题 I have a problem with creating an XML file from inside a SQL PROCEDURE. The XMLs get created and placed in the correct folder. Although when I open the file in XMLSpy, it says the following error: Your file contains 3 character(s) that should not be present in a file using the Unicode UTF-8 encoding... The offending characters are è (0xE8), ü (0xFC), é (0xE9) When I open the XML file in Notepad++ and check for encoding (via menu Encoding on top), it says it is in ANSI and not in UTF-8. So my

Extract OLE object data in Microsoft Office without OLE application

倖福魔咒の 提交于 2019-12-11 04:02:05
问题 Is it possible to extract the content of an embedded OLE object in Microsoft Office using VBA/VSTO? I am talking about a situation where the application with which the OLE object was created is not available. In this case some sort of converter application could make use of the raw data. For instance, in Excel the object is accessible via ActiveSheet.Shapes(x).OLEFormat but I have not found a way to retrieve the raw data of the object. One way would be to open the native file (Office Open XML

Is there a good reference for using OLE Automation (from Java)?

拥有回忆 提交于 2019-12-11 02:42:25
问题 I am trying to communicate with Excel from a Java/SWT application. I have been able to open a worksheet, open a file and save it but that's about it. Can anyone point me to some documentation/examples for this? I especially need to know which commands are available. I did try to record macros to inspect. This was useful but did not give me everything I wanted. This is a sample of what I have been trying so far: private static OleAutomation openFile( OleAutomation automation, String fileName)

How can I create a IDataObject instance with Delphi?

别来无恙 提交于 2019-12-10 23:57:16
问题 This C++ code shows how OLE can be used to simulate a file drag and drop to simulate a 'Send to...' operation. This will open the standard mail client with the selected file(s) as an attachment, a very interesting alternative to the mailto: protocol handler. Which is the best (short and safe) way to create the neccessary instance of IDataObject in Delphi? I have found some code here but maybe there is a better solution. 回答1: Porting the C++ code to Delphi probably isn't too difficult. Start

The OLE way of doing drag&drop in wxPython

被刻印的时光 ゝ 提交于 2019-12-10 23:53:12
问题 I have wxPython app which is running on MS Windows and I'd like it to support drag&drop between its instances (so the user opens my app 3 times and drags data from one instance to another). The simple drag&drop in wxPython works that way: User initiates drag : The source window packs necessary data in wx.DataObject(), creates new wx.DropSource, sets its data and calls dropSource.DoDragDrop() User drops data onto target window : The drop target calls library function GetData() which transfers