ole

I get an “Error: Cannot initialize OLE” when I try to connect to a database? C#

大憨熊 提交于 2019-12-12 20:34:20
问题 I'm trying to connect to a database via C#, but I'm getting a very unhelpful error message when I do so: "08:44:17: Error: Cannot initialize OLE 08:44:17: Error: Cannot initialize OLE" I've tried looking for a solution, but I've been unsuccessful. I also tried restarting my computer, which didn't help either. I am running SQL Server 2008, and here is the relevant database code: /// <summary> /// Connects to a given database and returns the database connection. /// </summary> /// <param name=

Using OLE to get text out of Powerpoint

笑着哭i 提交于 2019-12-12 09:41:31
问题 I am trying to use Win32::OLE to get a list of slides and their titles from the current presentation. So far I can get my $powerpoint = Win32::OLE->GetActiveObject('Powerpoint.Application') my $ap = $$powerpoint { ActivePresentation } ; my $slides = $$ap { slides } ; But $slides only has properties Application Count Parent Can anyone point me to take this futher. I realise an obvious answer is don't use Powerpoint. Corporate dictat and all that. 回答1: See also my answer to Automating a Job at

NullPointerException thrown when instantiating and OleControlSite on Windows 7

老子叫甜甜 提交于 2019-12-12 05:38:39
问题 I am getting a NullPointerException when trying to open excel from SWT. Sadly I can't post the full stacktrace and some of the code because it has references to the company that I work for. Hopefully someone has run into this issue before and might recognize it. Here is the part of the stacktrace that I can post java.lang.NullPointerException at org.eclipse.swt.ole.win32.OleControlSite.disconnectEventSinks(OleControlSite.java:468) at org.eclipse.swt.ole.win32.OleControlSite

SSAS - OLE DB error in establishing a connection

偶尔善良 提交于 2019-12-12 04:47:04
问题 I have a problem when I try to process a SSAS project in Visual studio 2013 (sql server 2012) using Pubs data sample of Microsoft. Could anyone tell me how to resolv it? Thanks in advance! OLE DB error: OLE DB or ODBC error: A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL

Embedding Pdf with OpenXml in PowerPoint fails for newer versions

情到浓时终转凉″ 提交于 2019-12-12 04:05:05
问题 I need to progammatically embed Pdf documents in PowerPoint via OpenXml. According to this: Embedding files into Open XML documents using C# it is possible via OLE32.StgCreateStorageEx methods to create the necessary picture as well as the oleobject. Unfortunately this doesn't work with current versions of PDF. On a 64 bit OS, this seems to work only with Abobe version 9.Higher version fails with error code 0x8000FFFF which translates to Catastrophic failure. This is actual true after testing

Interface Marshalling in Delphi

こ雲淡風輕ζ 提交于 2019-12-12 03:45:13
问题 I want to send Interface Ref of IVApplication from Visio Add-in to my other one COM server. But I have Ole exception. Now i do that: Code in Visio Add-in: var IStrm: IStream; hres: HResult; rhglobal: HGLOBAL; VisioAppl: IVApplication; begin hres := CreateStreamOnHGlobal(0, TRUE, IStrm); if Succeeded(hres) then hres := CoMarshalInterface(IStrm, IID_IVApplication, VisioAppl, MSHCTX_LOCAL, 0, MSHLFLAGS_NORMAL); if (Succeeded(hres)) then begin hres := GetHGlobalFromStream(IStrm, rhglobal); if

Insert a Date field into a Clipper Database using OLE

你离开我真会死。 提交于 2019-12-12 01:35:13
问题 We're trying to insert data into a clipper database file (DBF file with NTX index file). For a variety of reasons, we cannot change the database format. We are currently seeing two issues: With our existing code, we are not able to update or utilize the NTX index file (I believe). We would like to be able to do this. Do you know of an OLE or ODBC driver that can do this? We are able to insert a row into the clipper database file (DBF) as long as we do not include a date. If we include a date,

c++ Excel OLE automation. Setting the values of an entire cell-range 'at once'

余生颓废 提交于 2019-12-11 19:06:17
问题 IDE: Embarcadero XE5 I am attempting to improve the performance(speed) of an 'export to excel' procedure. The procedure contains way too many OLE function calls and property read/write calls, hence the poor performance. At present, a grid(2D array) is exported to excel by stepping through each cell in the grid and setting it's value. I'm trying to export the entire grid into a excel cell-range at once, but failing in my attempts. Now for Embarcadero Delphi-users this seems to be a trivial

Where to find OLE Automation's documentation

自古美人都是妖i 提交于 2019-12-11 18:57:58
问题 Indeed this is a very basic question but I unable to find any official documentation of the Microsoft OLE Automation interface. I would like to interract with Word and Excel through VBScript or Perl. I found plenty of examples on google but it would be much easier to get the full API documentation and it seems I cannot find anything on google even with these keywords: Microsoft, API, OLE, documentation, man, list of methods, library... I am starting from this point: my $excel= Win32::OLE->new

How can a simple string comparison cause an OleException?

点点圈 提交于 2019-12-11 18:46:47
问题 I have this piece of C++ code: static CString timeout(_T("TIMEOUT")); if(strError.Left(7).CompareNoCase(timeout) == 0) return TRUE; In my immediate windows, I see following value for strError : ? strError L"" ATL::CSimpleStringT<wchar_t,1>: L"" I'm getting following exception (I'm debugging a crash dump): Unhandled exception at 0x74B4A9F2 in CRASH.DMP: Microsoft C++ exception: COleException at memory location 0x01BFFD14. occurred My call stack is the following: KERNELBASE.dll!_RaiseException