com

Automation server can't create object

橙三吉。 提交于 2020-01-06 05:35:07
问题 I am writing a C# object that I need to be able to access from a javascript application. var util = new ActiveXObject('Namespace.Class'); However, when I attempt to create the object I get an error saying, "Exception: Automation server can't create object." I have registered the object for COM interop and the assembly is signed. NOTE: This is NOT a webpage and is NOT being run in the browser. I am able to create other COM objects in this same way, so my security settings are already set, and

Adding/Removing COM Ports from a ComboBox in C#

百般思念 提交于 2020-01-06 04:52:27
问题 I am attempting to write a program that utilizes a ComboBox to display currently connected COM ports obtained from the following method: System.IO.Ports.SerialPort.GetPortNames() The idea is to initialize a thread that checks the currently available COM ports every second, and update the ComboBox accordingly. Despite my best efforts, I can't get it to work. The code to update the ComboBox's contents is the following: private void Form1_Load(object sender, EventArgs e) { availPorts = new

Avoiding disconnected context warning when shutting down a thread on which STA COM objects have been created

删除回忆录丶 提交于 2020-01-06 04:38:07
问题 I am working on a COM API written in C++ with ATL, which clients will be expected to use in C# via it's COM interop facilities. Currently all the COM objects are only written to support the single threaded apartment model. Some of the functions of this API cause a separate worker thread to be spawned, which listens for events from a server. In response to events from the server this worker thread creates some fairly simple COM objects, and then passes these objects to a COM event. There are

Illegal character in path (of Resources file)

爷,独闯天下 提交于 2020-01-06 03:58:12
问题 I have a Windows Control Library project (visual studio 2010). I put in the compile tab for it to be a com element (I use it as an addin for another program). My question is the following: I have a .cvs file in my resources that I use to parse some main settings. The line of code that reads this file gives an error when I run the addin. code line: dim reader as new streamReader(My.Resources.standards) (the file is called standards) error I get when running the com element: Illegal character

Delphi - multiple remote com objects

梦想与她 提交于 2020-01-06 01:58:49
问题 My D5 application is on a server being used remotely by a couple of users, so I need use the following function to create a COM object to launch another application (LmPos) installed back on that users PC upon launch: CreateRemoteComObject(const MachineName: WideString; const ClassID: TGUID): IUnknown; rather than creating a local COM object as before: EposServer := CreateOLEObject('POS.Server'); However, the MachineName and ClassID to connect to will depend on which users is launching this

What decides whether RegisterTypeLib writes to win32 or win64?

断了今生、忘了曾经 提交于 2020-01-05 15:06:53
问题 I am working with two ATL-based COM projects. The both implement DllRegisterServer as just STDAPI DllRegisterServer(void) { // registers object, typelib and all interfaces in typelib return _Module.RegisterServer(TRUE); } which ends up calling ::RegisterTypeLib(pTypeLib, bstrPath, szDir); in atlbase.h:6516. But for some reason this call makes one of the projects create HKEY_CLASSES_ROOT\TypeLib\<guid>\<version>\0\win64 when registered using regsvr32.exe on Windows 7 32 bit. The other project

InternetExplorer.Application com object and windows 2012 in powershell

帅比萌擦擦* 提交于 2020-01-05 12:54:14
问题 I am trying to access the document of an internet explorer com object with windows 2012. The code works great in windows 2008 but as soon as I try to run it on windows 2012 (fresh install, tried on more than one server), the same code stops working. In other words, $ie.document.documentHtml returns as null. Below is the code: $ie = new-object -com "InternetExplorer.Application" $ie.navigate2("http://www.example.com/") while($ie.busy) {start-sleep 1} $ie.document.documentHtml.innerhtml Has the

InternetExplorer.Application com object and windows 2012 in powershell

喜欢而已 提交于 2020-01-05 12:54:10
问题 I am trying to access the document of an internet explorer com object with windows 2012. The code works great in windows 2008 but as soon as I try to run it on windows 2012 (fresh install, tried on more than one server), the same code stops working. In other words, $ie.document.documentHtml returns as null. Below is the code: $ie = new-object -com "InternetExplorer.Application" $ie.navigate2("http://www.example.com/") while($ie.busy) {start-sleep 1} $ie.document.documentHtml.innerhtml Has the

Using COM between different user accounts

試著忘記壹切 提交于 2020-01-05 12:26:30
问题 I need to do the following: Application "AppA" is run by user "UserA" Now AppA starts AppB using the runas-command (it is started as UserB) Is it now possible to let AppA control AppB via COM? While everything works fine without the different user accounts, I can't seem to get the COM object in the case mentioned above. By the way: I use Runtime.InteropServices.Marshal.GetActiveObject to get the COM object of AppB. Any ideas? Thanks! 回答1: I think you need to set the DCOM Security on the

Catastrophic failure on IIS Web Service when calling a COM method

馋奶兔 提交于 2020-01-05 09:05:27
问题 Maybe the worst type of error message that one can see. Does not mean anything, may be related to everything... I try to create a web service (WS) on IIS 7.5 (I have initially tried WCF services but same story) The WS uses a COM DLL which is successfully registered and the COM security permissions are given. When I run the WS using Visual Studio Development Server everything is fine, I get the results as requested. But when I try to deploy the WS to IIS, I end up with System.Runtime