Questions tagged [comobject]

200 questions
1
vote
1 answer

Select All Cells in Active Worksheet using ComOject Excel.Application in Powershell

Very new to Powershell. Situation: My script below is meant to do the following: Open New Workbook Put "This is A1" in the cell 'A1' Select all cells in the Active Worksheet Set the selection to TEXT data format Here is my Script for…
Chad Echicken
  • 35
  • 1
  • 9
1
vote
1 answer

C# Excel process won't close

I'm writing a program where you can enter stuff into an excel via a button. When the button is pressed the Application is started it interacts with the spreadsheet. But when it's finished interacting the process should be closed completely but it…
Triims
  • 75
  • 6
1
vote
0 answers

How to marshal C# type to LPWSTR *

I have a native C++ project which has a struct that looks like this: struct COMStringArray { long lSize; LPWSTR * array; }; Which uses a com object written in C#, so I need to marshal my C# types to be used in my C++…
Norbert Forgacs
  • 605
  • 1
  • 8
  • 27
1
vote
0 answers

C# COM server returning E_POINTER from GetIDsOfNames

I'm trying to create a COM server in C# to expose an OLE automation object. I'd like to implement the IDispatch interface manually, since I need to do some amount of dynamic lookup for the members. When i call my custom GetIDsOfNames the C# method…
Delusional Logic
  • 808
  • 10
  • 32
1
vote
1 answer

Using Unicode (PIC N) in safearray in Native Cobol

I need to create safearray (to pass it into COM object outside Cobol), and each item in this safearray must be PIC N string. I am using this code: 05 w-hostArray object reference. 05 w-listA. 10 w-item …
Pavel Matras
  • 329
  • 1
  • 5
  • 13
1
vote
0 answers

How to Make a ComObject "internetexplorer.application" settings persist through new window navigation

Within Citrix, we are calling a site by using the path as the PowerShell local path: %SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe And using The following command line argument: . C:\Temp\IELockdown.ps1 -server…
Thoughtwrong
  • 25
  • 1
  • 3
1
vote
0 answers

Remote execution of powershell script with autosys - to interact with IE _ComObject

I have a Powershell script designed to automate the testing of some URLs. The script invokes an Internet Explorer session as such: $IEProcess = Start-Process -FilePAth 'C:\Program Files (x86)\Internet Explorer\iexplore.exe' -ArgumentList "-private…
1
vote
1 answer

DirectShow (C#): Weird black screen issue

I am new to COM and C#. I have a pretty basic filter graph that is modified to show the image on a picturebox in winforms application. Everything is working as expected in a regular PC. But I am getting black image on picturebox (as if the same…
dp2050
  • 332
  • 3
  • 8
1
vote
2 answers

COM coobjects and interfaces C#

I am completely new to this and am following a tutorial on msdn: http://msdn.microsoft.com/en-us/library/aa645736(v=vs.71).aspx#vcwlkcominteroppart1cclienttutorialanchor2 My question is why do we use COM Interfaces AND COM CoClasses? It seems odd to…
LunchMarble
  • 5,079
  • 9
  • 64
  • 94
1
vote
0 answers

COM object run as elevated privileges in C#

Currently I am calling ADMT COM object in C# with the following code. Type admtMigration = Type.GetTypeFromProgID("ADMT.Migration",true); dynamic admt = Activator.CreateInstance(admtMigration); IList
KanisXXX
  • 757
  • 7
  • 19
1
vote
2 answers

When to correctly release Outlook COM-objects?

I know similar questions have been asked here, but I feel like I don't understand it correctly. I have the following code for example: Microsoft.Office.Interop.Outlook.Explorer expl = myOutlooApplication.ActiveExplorer(); if (expl.Selection.Count >…
cmos
  • 482
  • 4
  • 14
1
vote
0 answers

Compile a COM (ActiveX) dll using .NET Core CLI (dotnet.exe) and register it with Regasm.exe

I need to create a dll in C# to use in visual foxpro as COM object. I have Visual Studio Code installed with C# extension and the .NET Core Tools. The dll that I compile does not register accusing RegAsm : error RA0000. The procedure I took was as…
1
vote
1 answer

Does clearing a List containing ComObject, release all of them in c#?

I have a list containing different ComObjects. If I do myList.Clear() would it be enough or should I loop through it and does this. for (int i = 0; i < myList.Count; ++i) if (System.Runtime.InteropServices.Marshal.IsComObject(myList[i])) …
Lion King
  • 495
  • 5
  • 14
1
vote
3 answers

Com Object Exception

I wrote an application that loops through a set of records and prints two things. One is a report from SSRS wich works correctly. The other is a drawing that uses a COM object to print. The COM object randomly fails and causes the program to quit.…
Travis
  • 3,389
  • 2
  • 19
  • 11
1
vote
0 answers

System.__ComObject in Battery.FromIdAsync(id)

I am currently playing with Windows.Devices.Power. I have created a watcher for Bluetooth devices, and already retrieved the devices which were discovered nearby. But the problem is that when I try to get the battery level of specific device, I am…
L.V
  • 151
  • 1
  • 3
  • 9