Questions tagged [interop]
Interoperability is a requirement for one computer system or programming language to work with another.
5,608
questions
-1
votes
0
answers
33
views
Using WPF in WindowsForms, interoperability? [closed]
We are developing an WinForms app. for the last 25 years. Datagrids have always been slow to resize/render if big. Because of that I would like to use WPF for two "windows".
I would prefer ...
0
votes
0
answers
34
views
Get RCW's from Marshal to see which object is being held
I have an Excel add-in that needs a lot of long running references to Excel native objects. Every now and then when a user closes Excel it 'hangs' keeping an Excel process live in the background.
...
0
votes
0
answers
8
views
How can I set UsedRange of a sheet only for cells that contain an active value?
Is there something similar to UsedRange property of Microsoft.Office.Interop.Excel.Worksheet that only loops through the range that contains an active value e.g. cell is not empty?
Now it loops ...
1
vote
1
answer
51
views
Swift expose the protocol to objc in protocol oriented programming
I have this code which works well:
public protocol PermissionProvider {
static func authorizationStatus(for mediaType: AVMediaType) -> AVAuthorizationStatus
}
extension AVCaptureDevice: ...
0
votes
0
answers
8
views
If a user is the Admin of a Locking Amount Smart Contract, can that user transfer that money as desired anywhere?
I have a few questions regarding Blockchain.
First, Let's assume a user owns the constructor of a smart contract (he's the admin), what is his level of management on that locked amount? Can he ...
0
votes
0
answers
47
views
Show / Hide ComposeView in XML - Android, Kotlin, Jetpack Compose, Interoperability
I am adding a ComposeView to my XML layout. The ComposeView is a widget that will stay hidden until a button is clicked (button is in XML).
I have tried a number of things, but the way the app is ...
2
votes
0
answers
76
views
Intermittent crash when I call C++ from C#
I have a C++ API which I cam calling from C# and it crashes intermittently after running normally sometimes up to 5h.
The C++ side:
struct Doubles
{
double d1
double d2;
};
struct Package
{
...
1
vote
1
answer
34
views
java.lang.Class cannot be cast to clojure.lang.IFn when date capturing and string formatting
I'm not really seeing where I'm going wrong here, especially since I hit upon a minor variation at one point that allowed this, but couldn't explain why it worked. Please also tell me, in a more ...
1
vote
1
answer
60
views
Create and allocate a pointer inside struct C#
I am facing the following issue.
I have a C++ API passed to C# through DLL. Here is how the api looks like:
header.h
extern "C" __declspec( dllexport) bool f(CustomClass* myclass);
where:
...
1
vote
1
answer
50
views
Word Interop Add Document Property Field to Table - "System.Runtime.InteropServices.COMException: 'This command is not available.' "
I'm trying to add a field for a custom document property into a table in a Word document using the Word Interop. However, when I do this I'm getting an error:
"System.Runtime.InteropServices....
0
votes
0
answers
16
views
Windows shell drag-and-drop not working only for Chrome
I need to implement shell style drag-and-drop action in my C# WPF app.
I am following this MSDN article, using imported COM functions.
Currently, my app could drag combined file/custom data to most ...
1
vote
0
answers
27
views
Create automatic DLL api binding from C++ to C#
Suppose I have a C++ DLL and a header file containing all the API's.
extern "C" __declspec(dllexport) void* f1(const char* name);
extern "C" __declspec(dllexport) bool f2(const ...
0
votes
0
answers
28
views
Convert XML to word template using Microsoft.Office.Interop.Word
I want to convert XML to word template and when I used the code below when I open the word document it show all test like
(PK ! @qu é [Content_Types].xml ¢( ...
0
votes
1
answer
43
views
Blazor WASM passing obj to JS empty unless serialised as json. Other objects work
Essentially I can only pass primitives and anonymous types as argument in Blazor interop with JS.
My first post on stack overflow ever because I just cant figure this out:
This example works:
C#:
...
0
votes
1
answer
59
views
Why do Office updates break the Excel interop?
I'm writing Selenium automation in C# in Visual Studio 2019, and have a Microsoft Office 16.0 Object Library COM reference so that I can open Excel sheets and read in data. The version of Excel I'm ...
0
votes
1
answer
38
views
C# Word Interop adding bottom border to paragraph creates a newline I want to get rid of
I'm trying to add a bottom border to my text in order to create an horizontal line just under it. Inserting the line is no problem, but I get a newline just before and don't know how to get rid of it.
...
0
votes
1
answer
32
views
Is there a way to get multiple parameters back from an interop call in nanoFramework
I am trying to get multiple parameters from a struct in a single interop call. The struct in question has the following signature:
struct struct_name
{
uint16_t param0;
uint8_t param1;
...
1
vote
0
answers
137
views
Interop C# .net 6.0 Excel system.IO.FileNotFoundException could not load
I have a question about .net 6.0 and Excel, specifically about interop.
I had a look at this post which seems similar but it doesn't really answer my question.
Is it possible to use .net 6.0 with ...
1
vote
0
answers
64
views
PowerShell Excel Interop - InvalidCastException, but only from VS Code
I have a large PowerShell script that automates the creation of an Excel workbook from scratch. For months now, I have been unable to resolve one issue - but only when run from Visual Studio Code. ...
1
vote
1
answer
74
views
HOOKPROC callback doesn't get called by the hook - C#
I'm trying to set a low-level keyboard hook. I have DLL with the following code:
using System.Diagnostics;
using System.Runtime.InteropServices;
namespace InputListener;
public class ...
0
votes
0
answers
25
views
UnmanagedType.VBByRefStr Obsolete
I have this 3-party dll and the import declarations they provide uses UnmanagedType.VBByRefStr for marshaling strings. Works without problems.
However, VS now says that UnmanagedType.VBByRefStr is ...
0
votes
0
answers
32
views
Modular js with Dart 'js' package
With the dart interop js package I am struggling to find a way of using multiple js files (either with CommonJS or ES6 syntax). It appears that as soon as an import statement is used within an ...
2
votes
0
answers
78
views
How can I get a VB6 program that references a COM-visible .NET library that depends on other .NET libraries to work?
I have created a simple .NET COM-visible DLL 4.7.2 which I successfully exposed to COM via project settings as well as class tags like:
<ComVisible(True), Guid("4420535A-7EDA-4EB1-8CFE-...
0
votes
0
answers
35
views
Dart: Close RecivePort from C finalizer
A dart object has a ReceivePort member, to be able to get notified from C (C++) code (Not necessarily from dart thread). When the object is collected by the GC, the port should be closed too, but it ...
0
votes
0
answers
18
views
c# unmanagedfunctionpointer reference managed class?
I want to achieve this (pseudocode)
class A
{
public void Func1(){}
}
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate void onFunc1();
var a = new A();
...
0
votes
2
answers
40
views
Loading Interop.Word.dll during runtime
I am currently working on a small console app that should have some sort of integration with Microsoft Word. I guess users might have different versions of Microsoft Office and thats why I decided to ...
0
votes
0
answers
28
views
.NET Interface pointer not being recognized in C++ code
I have the following interface created in .NET that is supposed to be used in C++ code:
namespace MainWindow.Host
{
[ComVisible(true)]
[Guid("6B9F2DE8-2A81-40AA-8604-2B90450CEF49")]
...
0
votes
0
answers
65
views
Interop for macOS native data types and .NET 6
I'm currently writing a cross-platform headless C# Application using .net 6, and I need to access a few native macOS methods from the ApplicationServices framework.
I've got it working using P/Invoke ...
0
votes
1
answer
36
views
Interop Word - Wrong page size when converting a DOCX file to PDF
I'm running a .NET program in a Windows Server 2012 that converts docx files to pdf.
The program has been developed using the interop library and it has been running for around a year in the same ...
0
votes
0
answers
76
views
How can I use a static library in a React Native iOS application?
I have a static library written in Rust that is compiled against the iOS CPU architecture, but I don't know how to link it when my Native Module for iOS is compiled. So with this code:
#import "...
1
vote
3
answers
141
views
How to call Python from C++?
From the docs :
cppyy is an automatic, run-time, Python-C++ bindings generator, for
calling C++ from Python and Python from C++.
(Emphasis mine)
I don't see any instructions for doing the same, ...
1
vote
0
answers
42
views
Passing parameters from c++ to c# as call back
I have a c++ and c# application talking to each other.
The way I have set things up is as follows:
the c++ project is referred to in the c# project as follows
Now it does various things which are not ...
1
vote
0
answers
44
views
C# DLL Interop: native function receives different value of parameter than what it was called with from C#
I have a problem, I'm doing some C#<->C++ interop via a C interface and I have a function that I import from a dll like this
[DllImport("pixi_api", EntryPoint = "...
1
vote
2
answers
150
views
C# / C++ Interop: How to modify class in C++ memory from C#
I'm including a C# DLL in my C++ project, and I want both to be able to edit the same struct or class in memory easily I could use functions to set/get the members or struct, but I think this would ...
-3
votes
1
answer
44
views
How to efficiently marshal array of objects to native function using C++/CLI
I have array of objects holding primitive types and enums; how do I marshal a pointer to this data to a native function with the signature native_func(void* ptr[]).
array<System::Object^>^ ...
0
votes
1
answer
53
views
Converting Collection of Bookmarks to List<Bookmark>
I get the bookmarks in an existing Word-Document as follows
using System.Collections.Generic;
using Word = Microsoft.Office.Interop.Word;
namespace Word_Project
{
public class WordDoc
{
...
0
votes
0
answers
229
views
How to receive JavaScript object in C# when using Webview2 without using JSON
I am playing with Webview2 and tried to pass JavaScript object to C# method of registered Host Object, but I do not know how to retrieve its content.
public object[] TestCall(string arg1, object arg2)
...
1
vote
1
answer
178
views
How to use glImportMemoryWin32HandleEXT to share an ID3D11Texture2D KeyedMutex Shared handle with OpenGL?
I am investigating how to do cross-process interop with OpenGL and Direct3D 11 using the EXT_external_objects, EXT_external_objects_win32 and EXT_win32_keyed_mutex OpenGL extensions. My goal is to ...
1
vote
1
answer
71
views
How to close OneNote cleanly when a C# interop console app is closed
I am relatively new to C# and Visual Studio, and I am completely new to Microsoft.Office.Interop.OneNote. I have begun work on a console app using as a starting place the code in this answer, which is ...
0
votes
0
answers
36
views
interop method call bad parameter
I need to invoke the c++ library method in c# but after trying different variations still it returns an error code -2 saying that it is a bad parameter.
Here is the C++ representation of the structure ...
1
vote
0
answers
204
views
create a nuget package with dll in c# and c++
In my C# project I use purely C# dll, but for some functions it is possible to use only C++ libraries and dlls.
What I am trying to do is create a Nuget package consisting of C# dll and C++ dll.
Using ...
0
votes
1
answer
18
views
Trying to generate a word document in a .NET Windows Service
In a Windows Service I'm trying to convert a document from word to pdf.
The code used is pretty simple:
/// <summary>
/// Generate a PDF document from a Word document.
/// </summary>
/// &...
0
votes
0
answers
107
views
Cannot load JPG image Pdfium
I try to do some stuff with PDF for a project. I'm trying to do some interop with Pdfium: https://pdfium.googlesource.com/pdfium/.
I want to convert a JPG image to a PDF (just for the start). So I ...
5
votes
0
answers
338
views
Importing a C# .NET 6.0 Core Dll into a C++ without TLB file
I have quite a number of C# Dlls that were made in .NET 4.6 Framework and need to get upgraded to .NET Core 6 - that part is relatively straightforward.
However, this library ALSO is used within a C++ ...
-1
votes
1
answer
53
views
CascadeWindows but except for the caller window
Can I cascade all windows with this method
[DllImport("user32.dll")]
public static extern ushort CascadeWindows(
HWND hwndParent,
uint wHow,
...
0
votes
0
answers
27
views
C# Excel continues running in the background even after code execution is complete [duplicate]
I am currently using Microsoft.Office.Interop.Excel for a C# windows forms project, but I have been struggling to find answers as to why the excel process continues running in the background even ...
0
votes
1
answer
18
views
Initialize interop Excel app on the background
I am developing a ASPNET web app which uses interop for different tasks. In order to make the app faster I was wondering if I can run Excel on the background while the view is loading. I tried the ...
-1
votes
1
answer
68
views
VC++ Interop DLL: Binary was not built with debug information
I have a VC++ (.exe) application built in Visual Studio 2019. In project properties I have set to generate debug information for it.
Configuration Properties --> C/C++ --> Debug information ...
0
votes
1
answer
40
views
Debugging VC++ DLL suddenly stops working
Basically I have a C# app under traditional .NET 4.5 that references a DLL built in VC++.
Now I need to debug the code within the VC++ DLL (COM Server) referenced so I put some breakpoints there.
Once ...
0
votes
0
answers
107
views
Objc interop. Type 'ObjcProtocolImpl' cannot conform to protocol 'ObjcProtocol' because it has requirements that cannot be satisfied
Same issue, but i think it doesn't use external modules Type "SwiftClass" cannot conform to protocol "ObjcProtocol" because it has requirements that cannot be satisfied. In my ...