interop

c# MSOffice Interop Word will not kill winword.exe

☆樱花仙子☆ 提交于 2019-11-30 17:55:27
I'm writing an application that needed a MSWord document parser. I'm using Microsoft.Office.Interop.Word.Document to extract the texts from the documents, but even if i use doc.Close() the document, from taskManager i can see that winword.exe are not killed, and after parsing a couple dozens documents it eats up some much resources. is close() the wrong method? please help me and point me to the right direction on how to terminate these processes properly. =) ~~~update~~~ Thanks for all the help. I use the app.quit() and also ran a loop that checks for the process and problem solved! =) Are

C# Excel interop: Exception from HRESULT (DISP_E_BADINDEX)

北城余情 提交于 2019-11-30 17:44:25
问题 I'm trying to deploy an application that works fine on my development pc and some other workstations. However, some users receive an error that I can't seem to grasp. The program is a C# dotNet app with Excel.Interop functionality (Office 2003). I seem to be getting a problem with 'indexes'. The weird thing is that this part works perfect on some machines but throws a fatal exception on others... All machines are Windows 7 with Office 2003. This is the relevant code: //Change sheet code

64 to 32 bit Interop - how?

那年仲夏 提交于 2019-11-30 17:37:12
I need to integrate some legacy 32-bit code - for which I don't have the source code, into a project in such a way that it can be called from a 64-bit .NET assembly. The original code is implemented as a 32-bit COM object in a DLL. Windows doesn't allow direct calls from 64 to 32-bit objects, so I'm looking for inspiration on how to deal with this situation. How can a legacy 32-bit COM object be accessed from a 64-bit .NET assembly? UPDATE: We discovered that the COM component was itself a wrapper around some ANSI C, which we founf the original source for. We were able to compile that in

C# - way to programmatically advance Powerpoint slide show?

走远了吗. 提交于 2019-11-30 17:33:00
I'd like to be able to advance through a Powerpoint presentation by pressing buttons in a Windows form. Here's some code I've found from http://bytes.com/topic/c-sharp/answers/272940-open-powerpoint-presentation-c-window-form that opens a Powerpoint presentation slide show: Microsoft.Office.Interop.PowerPoint.Application oPPT; Microsoft.Office.Interop.PowerPoint.Presentations objPresSet; Microsoft.Office.Interop.PowerPoint.Presentation objPres; //the location of your powerpoint presentation string strPres = @"filepath"; //Create an instance of PowerPoint. oPPT = new Microsoft.Office.Interop

Accessing scala object fields from java

蓝咒 提交于 2019-11-30 17:26:31
I'm having trouble accessing the fields of a scala object from java. Scala: object TestObject { val field = 5 } Java: public class JavaTest { public static void main(String[] args) { int i = TestObject.field; } } Error: [error] JavaTest.java: cannot find symbol [error] symbol : variable field [error] location: class TestObject [error] int i = TestObject.field; Scala fields are private variables with a getter of the same name to preserve immutability. public class JavaTest { public static void main(String[] args) { int i = TestObject.field(); } } 来源: https://stackoverflow.com/questions/7788363

Method not found: 'System.Type System.Runtime.InteropServices.Marshal.GetTypeFromCLSID(System.Guid)'

点点圈 提交于 2019-11-30 16:59:43
问题 I spent a good deal of time writing this program on my dev box, after moving it to our production boxes I get the error below. Just an FYI I don't have any control over what is installed and what can be installed, how can I make this work? Under both framework on both computers we have v1.0.3705, v1.1.4322, v2.0.50727, v3.0, v3.5, 4.0.30319. Also the program I used to create the app is Visual Studio 2013 Pro. Thanks See the end of this message for details on invoking just-in-time (JIT)

Consuming C# WCF service from Delphi 2010 client: Databinding and Entity Framework

泪湿孤枕 提交于 2019-11-30 16:26:25
I am migrating a win32 Delphi VCL application written in Delphi 2010 to a multi-tiered architecture. The application makes extensive use of ExpressGrids (TcxGrid) by devexpress for databinding. I have designed the data tier based on Entity framework, using dbContext and Data transfer objects. I have expose the CRUD operations via WCF using T4 templates based on the entity data model. That's all working fine, Delphi client successfully communicates with the WCF service, to exchange data transfer objects. The problem is, how do I maintain the Databinding functionality ? I am leaning toward

Programmatically Printing in Adobe Reader 9 using .NET Interop

 ̄綄美尐妖づ 提交于 2019-11-30 16:22:00
问题 I am using VB.Net WinForms. I would like to call the Adobe Reader 9 ActiveX control to print some PDFs. I have added the ActiveX control to the VS toolbox (the dll is AcroPDF.dll, the COM name "Adobe PDF Reader". After some experiment the following code works. Dim files As String() = Directory.GetFiles(TextBoxPath.Text, "*.pdf", SearchOption.TopDirectoryOnly) Using ActiveXPDF As New AxAcroPDFLib.AxAcroPDF Me.Controls.Add(ActiveXPDF) ActiveXPDF.Hide() For Each filename As String In files

Programmatically Printing in Adobe Reader 9 using .NET Interop

徘徊边缘 提交于 2019-11-30 16:20:46
I am using VB.Net WinForms. I would like to call the Adobe Reader 9 ActiveX control to print some PDFs. I have added the ActiveX control to the VS toolbox (the dll is AcroPDF.dll, the COM name "Adobe PDF Reader". After some experiment the following code works. Dim files As String() = Directory.GetFiles(TextBoxPath.Text, "*.pdf", SearchOption.TopDirectoryOnly) Using ActiveXPDF As New AxAcroPDFLib.AxAcroPDF Me.Controls.Add(ActiveXPDF) ActiveXPDF.Hide() For Each filename As String In files ActiveXPDF.LoadFile(filename) ActiveXPDF.printAll() 'Begin Yukky Hack ' Dim endTime As Date = DateAdd

Consuming C# WCF service from Delphi 2010 client: Databinding and Entity Framework

心不动则不痛 提交于 2019-11-30 16:08:17
问题 I am migrating a win32 Delphi VCL application written in Delphi 2010 to a multi-tiered architecture. The application makes extensive use of ExpressGrids (TcxGrid) by devexpress for databinding. I have designed the data tier based on Entity framework, using dbContext and Data transfer objects. I have expose the CRUD operations via WCF using T4 templates based on the entity data model. That's all working fine, Delphi client successfully communicates with the WCF service, to exchange data