ole

Which date format does VarToDateTime(VarDateFromStr) use?

。_饼干妹妹 提交于 2019-12-23 03:52:35
问题 I've been having problems lately with date conversion lately. Some workstations my application run on don't convert string to date correctly. I tracked the issue down to VarDateFromStr that doesn't seem to be checking LOCALE_SSHORTDATE to make the conversion. I was wondering if anyone knew what it DID check for the conversion. Or does the different behavior only linked to different DLL version? GetLocaleStr(GetThreadLocale, LOCALE_SSHORTDATE, 'm/d/yy'); // returns 'dd-MM-yyyy' FormatDateTime(

How to cast a control to IOleObject

一个人想着一个人 提交于 2019-12-22 17:36:14
问题 I want to invoke GetClientSite on a .net control. For this purpose I am trying to cast a control (in example Windows.Forms.Form) to IOleObject which returns null. What should I do to get IOleObject? using System; using System.Runtime.InteropServices; using System.Security; using System.Windows.Forms; namespace Test001 { public class Form001 : Form { public Form001() { InitializeComponent(); } private void InitializeComponent() { this.SuspendLayout(); this.Name = "Form001"; this.Text =

International date formatting issues in OLE Excel output

大城市里の小女人 提交于 2019-12-22 12:56:17
问题 In a product I am currently working with Excel spreadsheets are generated using OLE from Delphi. The spreadsheets include a number of dates where the application loads the shortdate format from the system settings and applies this to the cells. This works perfectly except when the system formats are set to one of at least Russian, Bashkir, Tatar, Yakut, Kazak and Uzbek (there may be others I have not tried). The code is- xlws.Cells[irow,icol] := ActivityData.Target_Date; xlvalidrange := xlws

Strip OLE header information (MS Access / SQL Server)

醉酒当歌 提交于 2019-12-22 11:13:18
问题 I have a C++ application that needs to support binary database content (images, etc). When using MS Access or MS SQL Server this data is wrapped inside an OLE object. How do I strip this OLE header information? Note that I can't just look for the beginning of a specific tag as the content can be png, jpg and a whole heap of other formats. Should I use something like COleDataObject? 回答1: Using MS Access 2007 (I need to test other MS databases) the format seems to be: 84 bytes file name + \0

How to use PowerShell to access methods and properties of a Third-Party OLE DLL?

半世苍凉 提交于 2019-12-22 10:54:35
问题 I am trying to write a PowerShell script which could access methods and properties of a third-party OLE DLL. The software vendor provided a working example in vbscript to achieve the same result. Below is an excerpt of the codes: Set objOLE = CreateObject("NETIQOLE.APPMANAGER") objOLE.Logon strInstance, strRepository, strUserID, strPwd ... However, when I tried to code in PowerShell as below: $objOLE = New-Object -ComObject "NETIQOLE.APPMANAGER" $objOLE | Get-Member I got output below and

From C#, open an arbitrary application

不羁岁月 提交于 2019-12-22 08:39:09
问题 Related question [stackoverflow] here. I'm trying to do the above, but I want to take the process one step further. I want to open an arbitrary file using the default editor for the file type. From that point, I want to allow my user to interact with the file as they would normally, or continue to work in my application. The extension is what happens after the user finishes editing. Is there a way I can capture a close (and ideally save) event from the external application and use that as a

Python: Access embedded OLE from Office/Excel document without clipboard

喜欢而已 提交于 2019-12-22 03:43:41
问题 I want to add and extract files from an Office/Excel document using Python. So far adding things is easy but for extracting I haven't found a clean solution. To make clear what I've got and what not I've written the small example test.py below and explain further. test.py import win32com.client as win32 import os from tkinter import messagebox import win32clipboard # (0) Setup dir_path = os.path.dirname(os.path.realpath(__file__)) print(dir_path) excel = win32.gencache.EnsureDispatch('Excel

Communicating with the OLE Server or ActiveX Control

僤鯓⒐⒋嵵緔 提交于 2019-12-22 03:16:57
问题 MS Access 2010, Win 7 on a regular form I didn't intentionally place any ActiveX or OLE things.. not even sure what they are. But anyways, whenever I put something in the code of a particular form, it says "The Expression XXXXX you entered as the event property setting produced the following error: A problem occured while MyDB was communicating with the OLE server or Active X Control Huh? No matter what I put in the form's code, this happens. I had an empty Form_Current() ONLY which still

COM / OLE / ActiveX / IDispatch confusion

和自甴很熟 提交于 2019-12-20 14:10:31
问题 I can't wrap my head around the differences among these terms. Are COM and ActiveX synonyms? Is ActiveX object just a COM object that exposes IDispatch? Lots of older MSDN pages mention IDispatch without any COM context. Does it have a separate history, and was just introduced under the COM 'umbrella' later in its lifecycle? Where does OLE fit in? Is its (considerable) presence in MFC naming and MSDN in general - all just legacy? Wikipedia gives some insight, but not much. I couldn't find a

“Cursor type changed” error on Perl OLE32 MSSQL dateadd function results

偶尔善良 提交于 2019-12-20 05:57:25
问题 The following sql "select DATEADD(day, DATEDIFF(day, 2, GETDATE()), '20:00:00') as A" runs perfectly fine in Microsoft sql query. However in perl, it complains with the following error "Description: [Microsoft][ODBC SQL Server Driver]Cursor type changed". I double checked and my code can run select and update statements with no issues so I am a bit stumbled about the cursor error. Note that I have not included my connection string but have illustrated that I am using win32::OLE. use Win32: