Questions tagged [interopservices]
84 questions
0
votes
0 answers
How to open an Excel file in PrintPreview without suspending the code
I'm new to C#/OpenXML and could not find an answer to this. Apologies in advance if it's a stupid question...
Basically, I am writing an application that creates Excel files from an input string. This input string may contain information about…

Nick McGurk
- 1
- 1
0
votes
0 answers
What to use instead of SafeHandle.DangerousGetHandle?
I was looking at my SonarQube static code analysis and came across a report that says using a SafeTokenHandle DangerousGetHandle method call.
I start by declaring a SafeTokenHandle:
SafeTokenHandle safeTokenHandle;
var returnValue =…

obizues
- 1,473
- 5
- 16
- 30
0
votes
1 answer
Zebra Printer: System.Runtime.InteropServices.COMException (0x8004FFFF)
We use the following code to print to a card.
byte[] image;
ZXPPRINTERLib.Job job = new ZXPPRINTERLib.Job();
job.JobControl.Destination = DestinationTypeEnum.Eject;
using (ZMotifGraphics graphics = new ZMotifGraphics())
{
…

André Haupt
- 3,294
- 5
- 32
- 57
0
votes
0 answers
How should I call Cntk.Core-2.5.dll from C#?
I have trouble calling Cntk functions from C#. The header file I'm using is CNTKLibraryC.h from a binary CNTK installation, and the DLL that I load is Cntk.Core-2.5.dll from the same installation. My interop signature for CNTK_LoadModel at the…

Yngve Moe
- 410
- 2
- 8
0
votes
0 answers
Tracking with windows services
Hi there I'm trying to track, when a specific word files opens with windows services with these below technique but these Methods aren't working in windows services please help me, provide me a through which I can achieve that.
1. Dim wordApp As…

Salahudin Malik
- 398
- 4
- 17
0
votes
3 answers
Acces Outlook via Visual Basic error
I'm trying to create a program which retrieves all emails from Outlook's(2007 desktop version) Inbox and puts them into a DataGridView.
Code:
Imports Outlook = Microsoft.Office.Interop.Outlook
Public Class Form1
Private Sub Form1_Load(sender As…

NielsStenden
- 357
- 1
- 6
- 25
0
votes
2 answers
System.Runtime.InteropServices.COMException (0x800A1436)
We are trying to open a Word template which resides on a Shared Drive using Office Interop Services on an MVC application.The solution is working locally, but once is deployed to the server the following message appears:
The File was not created:…

Alejo9552
- 3
- 3
0
votes
1 answer
Marshal unmanaged variables in c#
I am importing an unmanaged dll on my C# code. The .h file describes methods as shown bellow
DLL_API int __stdcall SetConfiguration(IN char* configuration);
DLL_API int __stdcall GetErrorMessage_UTF16(
INOUT int* errorGroup,
INOUT char*…

Dimitris Laliotis
- 83
- 10
0
votes
0 answers
Error saving a bitmap in C# System Runtime Interopservices External Exception
The code below works here and there. Sometimes it save the image just fine, and other times it doesn't. The image is being save locally and the folder has the correct permissions.
using (Bitmap bitmap = new Bitmap(bounds.Width, bounds.Height))
…

nate
- 1,418
- 5
- 34
- 73
0
votes
1 answer
Why would I get, "InteropServices.COMException / ForwardCallToInvokeMember" with this code?
After retrieving data and storing it in a generic list, I've got this code to populate an Excel spreadsheet using Excel Interop code:
. . .
InitializeExcelObjects();
_currentTopRow = DATA_STARTING_ROW;
foreach (PriceVarianceData _pvd in _pvdList)
{
…

B. Clay Shannon-B. Crow Raven
- 8,547
- 144
- 472
- 862
0
votes
0 answers
Connect to COM-object from Unity
I made a product configurator in Unity3D.
I want the Windows version of my configurator to communicate with Autodesk Inventor to make production drawings of the configured product.
I made a DLL file and use it as a plugin in unity:
namespace…

Maarten
- 53
- 6
0
votes
1 answer
WMPLib Console app exception on media play
I am not used to using InteropServices but what I am doing is using WMPLib to play songs from a console application. The application works as expected when I debug it from Visual Studio. But it crashes and gives me the following exception:
Unhandled…

lbrahim
- 3,710
- 12
- 57
- 95
0
votes
1 answer
Printpreview of an Excel file - Close file after dialog
I have a code which opens the print preview of an Excel file (over Interops Services). I use this to give the user a preview without manipulating the content. But when the print preview dialog gets closed, the file itself stays open. Is it possible…
user4664405
0
votes
0 answers
What is the cause and solution for this file inaccessibility?
Trying to get a basic VB.NET Excel file creation app working, starting from some sample code from here, I'm getting err msgs with this code:
Private Sub ButtonCreateExcelFile_Click( sender As Object, e As EventArgs) Handles…

B. Clay Shannon-B. Crow Raven
- 8,547
- 144
- 472
- 862
0
votes
1 answer
Microsoft Interops Word Insert Comment into Table Cell Crash Word
i want open a word document programmatically using Microsoft.Interop.Word and insert a comment into a table cell.
I have the start and End position of Range of the cell. (Range.Start \ Range.End)
Application.ActiveDocument.Select(); // select…