interop

COM/Interop - Supporting Multiple Versions

北战南征 提交于 2020-01-14 22:45:26
问题 I've written a .NET console app that wraps CuteFTP's Transfer Engine - a COM object (ftpte). The version I wrapped is CuteFTP 7.0. I'd like to also support the 8.0 version, as some of the clients I integrate with have that version. I have a reference in my Visual Studio project to the CuteFTP COM object... how can I reference the version 8.0 component and still support version 7.0? It seems to me that I'm forced to choose at design time, unless I make a bigger architectural shift. Ideas? 回答1:

Interoperability between Clang, GCC and LTO

帅比萌擦擦* 提交于 2020-01-14 16:46:26
问题 I know that Clang and GCC are more or less compatible C/C++ compilers as long as one takes care of things like architecture flags, predefines and linking the right libraries. Creating libraries with one compiler and linking them with objects created by the other is actually pretty easy (at least on x86). Here is a little test project doing exactly that: https://gitlab.com/higaski/Interoperability I was wondering however if Link Time Optimization (LTO) could somehow work across compilers? I

Swift/ObjC circular import

好久不见. 提交于 2020-01-14 08:43:19
问题 I am working on an existing large codebase that is predominately Objective-C but is in the process of converting to Swift. New classes are being implemented in Swift, but some of these classes need to be accessed from existing ObjC code. In an attempt to follow both ObjC and Swift best practices, the new classes do not have a prefix, but are defined with a prefix for ObjC. /** Create contrived class that is named XXClassA in ObjC and ClassA in Swift. */ @objc(XXClassA) class ClassA: NSObject

How can I assign a .NET 4 WinForm application to the owner property of a Delphi 7 form?

孤街浪徒 提交于 2020-01-14 03:10:28
问题 I need to assign a .NET 4 Winform application as the owner of a Delphi 7 form. I have created a .dll in Delphi which contains the form. The Delphi .dll exports methods to create and display the form. I have successfully loaded the Delphi .dll in my .NET app, and displayed the form. Now I need to be able to assign the .NET app (or main form of the .NET app) as the owner of the Delphi form. I have previously created a Delphi app that interops to .NET through COM, and assigns the Delphi app as

How can I assign a .NET 4 WinForm application to the owner property of a Delphi 7 form?

痴心易碎 提交于 2020-01-14 03:10:05
问题 I need to assign a .NET 4 Winform application as the owner of a Delphi 7 form. I have created a .dll in Delphi which contains the form. The Delphi .dll exports methods to create and display the form. I have successfully loaded the Delphi .dll in my .NET app, and displayed the form. Now I need to be able to assign the .NET app (or main form of the .NET app) as the owner of the Delphi form. I have previously created a Delphi app that interops to .NET through COM, and assigns the Delphi app as

FilePut does not prepend the two length bytes when writing a string to a binary file from C#. FilePutObject throws exceptions on classes/structs

浪尽此生 提交于 2020-01-13 19:46:53
问题 I have a app that needs to be both read and write compatible with a VB6 binary file. I learned about the Microsoft.VisualBasic.FileSystem class and I am trying to write out a structure to the file. FileSystem.FileOpen(file, "test.bin", Microsoft.VisualBasic.OpenMode.Binary); FileSystem.FilePut(file, patch.intTest); FileSystem.FilePut(file, patch.dateTest); FileSystem.FilePut(file, patch.stringTest, StringIsFixedLength: false); FileSystem.FilePut(file, patch.boolTest); Everything writes

Hide Excel 2013 while programmatic change a workbook

六眼飞鱼酱① 提交于 2020-01-13 19:03:53
问题 A really good new feature of Excel 2013 is that it cannot forced to show more than one Excel workbook in one application. This seems the cause of my Problem: If I open an Excel workbook programmatically using c# and interop Excel 2013 starts with a new application window. I can working with the workbook in code without problems but I want to hide the application. Using Excel.Application excelApp = new Excel.Application(); ...... excelApp.Workbooks.Open(...); excelApp.Visible = false; hides

COM returns type that does not implement any interface

安稳与你 提交于 2020-01-13 13:12:10
问题 I need to automate some tasks in Adobe InDesign CS3 from a .NET 4.0 application. I've added a reference to the InDesign Type Library using the Add Reference dialog in Visual Studio. It genereates an interop assembly, which correctly includes all of the interfaces and types declared in the type library. I haven't installed any Adobe SDK, as the type library was available in Visual Studio without installing anything but Adobe InDesign CS3. The interesting types in the interop assembly for me

Exposing events from .NET to COM

 ̄綄美尐妖づ 提交于 2020-01-13 06:54:28
问题 recently I have been encountering problems with exposing events from .NET to COM. I have been successful with this example (conceptually taken from http://blogs.msdn.com/andreww/archive/2008/10/13/exposing-events-from-managed-add-in-objects.aspx): // The delegate type for our custom event. [ComVisible(false)] public delegate void SomeEventHandler(object sender, EventArgs e); // Outgoing (source/event) interface. [ComVisible(true)] [InterfaceType(ComInterfaceType.InterfaceIsIDispatch)] public

Can I control version number assigned to interop assembly?

浪子不回头ぞ 提交于 2020-01-13 03:53:26
问题 I have a C# program that uses a native C++ COM object. Visual Studio generates an interop assembly with wrappers for the types in the COM object. Each time I recompile the C# program interop assembly has version 1.0.0.0. This is bad for the installer - sometimes we extend the COM object interfaces (add new methods at the end of some interface) so the interop assembly has to be changed. when the installer tries to update an existing installation it thinks that the interop assembly hasn't