interop

C# to VB6 COM events (“object or class does not support the set of events”)

断了今生、忘了曾经 提交于 2019-12-30 06:46:48
问题 Really pulling my hair out with this one... I have a C# project with an interface defined as: /* Externally Accessible API */ [InterfaceType(ComInterfaceType.InterfaceIsIDispatch)] public interface ISerial { [DispId(1)] bool Startup(); [DispId(2)] bool Shutdown(); [DispId(3)] bool UserInput_FloorButton(int floor_number); [DispId(4)] bool Initialize(); } /* Externally Accesssible Event API */ [InterfaceType(ComInterfaceType.InterfaceIsIDispatch)] public interface ISerialEvent { [DispId(5)]

C# to VB6 COM events (“object or class does not support the set of events”)

帅比萌擦擦* 提交于 2019-12-30 06:46:05
问题 Really pulling my hair out with this one... I have a C# project with an interface defined as: /* Externally Accessible API */ [InterfaceType(ComInterfaceType.InterfaceIsIDispatch)] public interface ISerial { [DispId(1)] bool Startup(); [DispId(2)] bool Shutdown(); [DispId(3)] bool UserInput_FloorButton(int floor_number); [DispId(4)] bool Initialize(); } /* Externally Accesssible Event API */ [InterfaceType(ComInterfaceType.InterfaceIsIDispatch)] public interface ISerialEvent { [DispId(5)]

C# = Why are Excel processes not ending?

。_饼干妹妹 提交于 2019-12-30 06:04:51
问题 I have the following code: private bool IsMousetrapFile(string path) { logger.Log(validateFileMessage + path); Excel.Application xlApp = new Microsoft.Office.Interop.Excel.Application(); Excel.Workbooks workbooks = xlApp.Workbooks; Excel.Workbook xlWorkBook = workbooks.Open(path, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing); Excel.Sheets

WPF WinForms Interop issue with Enable / Disable

假如想象 提交于 2019-12-30 03:10:26
问题 I have a WinForms usercontrol hosting a WPF custom Listbox in it. After the WinForms user control gets disabled and then re-enabled the WPF control in the WinForms usercontrol is unresponsive. Has anyone else experienced this? We had to hack a soultion into remove and re-add the element host each time the control gets disable / enabled to fix the issue. WinForms wpfControl.Enabled = false; ... wpfControl.Enabled = true; Hack for fixing it in the WinForms EnabledChanged method for the

How to query MS Access database with C# application?

烈酒焚心 提交于 2019-12-29 08:51:33
问题 I have an application that uses Microsoft.Office.Interop.Excel to pull data from an Excel workbook. The information in the Excel workbook has been moved to an Access database, and I have been tasked to update the application, so that it will look for the data in the database. I found the Microsoft.Office.Interop.Access reference, but how do I use it to open the database and run queries? The documentation on this on MSDN seems to be somewhat lacking. Maybe I'm looking in the wrong place... :\

Excel process still runs after closing in VB.net

江枫思渺然 提交于 2019-12-29 07:56:08
问题 My question is basically just how to end the Excel.exe process that runs when using excel. In the application I open and use an excel workbook with a couple sheets, then leave them for the user to do as they please, my problem is that my application never lets go of the Excel process. If the application is closed before closing excel, the process ends when excel is closed, otherwise if I close my application after closing excel, the process stays running. I've tried a few things I've found

“Bad binary signature” in ASP.NET MVC application

余生长醉 提交于 2019-12-29 07:33:18
问题 We are getting the error above on some pages of an ASP.NET MVC application when it is deployed to a 64 bit Windows 2008 server box. It works fine on our development machines, though these are 32 bit XP. Just wondered if anyone had encountered this before, and has any suggestions? Details as follows: Bad binary signature. (Exception from HRESULT: 0x80131192) Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more

Printing using Word Interop with Print Dialog

妖精的绣舞 提交于 2019-12-29 06:53:01
问题 I'm trying to print a word doc from my C# code. I used the 12.0.0.0 Word Interop and what i'm trying to do is to get a Print Dialogue pop up before the document prints. I'm not 100% sure of the syntax of all of this as I can't get my code to work :( Any ideas? Thanks in advance! 回答1: It should be something along the lines of: object nullobj = Missing.Value; doc = wordApp.Documents.Open(ref file, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref

Printing using Word Interop with Print Dialog

╄→尐↘猪︶ㄣ 提交于 2019-12-29 06:52:09
问题 I'm trying to print a word doc from my C# code. I used the 12.0.0.0 Word Interop and what i'm trying to do is to get a Print Dialogue pop up before the document prints. I'm not 100% sure of the syntax of all of this as I can't get my code to work :( Any ideas? Thanks in advance! 回答1: It should be something along the lines of: object nullobj = Missing.Value; doc = wordApp.Documents.Open(ref file, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref

Why do Objective-C APIs return implicitly unwrapped optionals?

那年仲夏 提交于 2019-12-29 05:56:10
问题 I am rather perplexed by this. If we take the method cellForRowAtIndexPath: in UITableView for example, it's method signature is: func cellForRowAtIndexPath(_ indexPath: NSIndexPath!) -> UITableViewCell! And its return value is: An object representing a cell of the table or nil if the cell is not visible or indexPath is out of range. That sounds like the perfect reason to use a standard optional. In fact, since all pointer based types in Objective-C can be nil... it seems to make sense that