com

Outlook Interop Exception

痴心易碎 提交于 2020-01-11 11:26:07
问题 Trying to automate Outlook as Microsoft.Office.Interop.Outlook.Application myApp = new Microsoft.Office.Interop.Outlook.ApplicationClass(); Microsoft.Office.Interop.Outlook.NameSpace mapiNameSpace = myApp.GetNamespace("MAPI"); and getting following exception at second line i.e. GetNamespace Unable to cast COM object of type 'Microsoft.Office.Interop.Outlook.ApplicationClass' to interface type 'Microsoft.Office.Interop.Outlook._Application'. This operation failed because the QueryInterface

JACOB doesn't release the objects properly

狂风中的少年 提交于 2020-01-10 11:45:40
问题 I have an eclipse plugin, which connects to a COM component using Jacob. But after I close the plugin entirely, the .exe file stays hanging in Windows processes. I use ComThread.InitMTA(true) for initialization and make sure that SafeRelease() is called for every COM object I created before closing the app and I call ComThread.Release() at the very end. Do I leave something undone? 回答1: Had the same problem with TD2JIRA converter. Eventually had to patch one of the Jacob files to release the

Can not add reference a COM in COM client?

谁都会走 提交于 2020-01-10 02:34:30
问题 A COM server is create and I registerd that. When I am trying to add that COM server in a COM Client, I was not able to add, and following error is comming. " A reference to 'COMTest' could not be added The ActiveX type Library 'c\user\~\Debug\COMTest.tlb' was exported from a .NET assembly and can not added as a reference. Add a reference to .NET instead " can anybody tell me What is the mistake. I register the COM in both way, from VS also and also tried with command prompt. 回答1: This is a

Query WMI from Go

夙愿已清 提交于 2020-01-09 13:06:29
问题 I would like to run WMI queries from Go. There are ways to call DLL functions from Go. My understanding is that there must be some DLL somewhere which, with the correct call, will return some data I can parse and use. I'd prefer to avoid calling into C or C++, especially since I would guess those are wrappers over the Windows API itself. I've examined the output of dumpbin.exe /exports c:\windows\system32\wmi.dll , and the following entry looks promising: WmiQueryAllDataA (forwarded to

How can I use JScript to create a shortcut that uses “Run as Administrator”

风流意气都作罢 提交于 2020-01-09 10:44:07
问题 I have a JScript script that runs using cscript.exe . It creates a shortcut on the desktop (and in the start menu) that runs cscript.exe with parameters to run another JScript script. It looks, in relevant part, like this: function create_shortcut_at(folder, target_script_folder) { var shell = new ActiveXObject("WScript.Shell"); var shortcut = shell.CreateShortcut(folder + "\\Run The Script.lnk"); shortcut.TargetPath = "cscript"; shortcut.Arguments = "\""+target_script_folder+"\\script.js\"

COM: excelApplication.Application.Quit() preserves the process

岁酱吖の 提交于 2020-01-09 10:28:49
问题 I'm using COM integration to drive MS Excel from Python 2.7. I noticed a peculiar thing: when I run the following bit of code: import win32com.client excelApp = win32com.client.dynamic.Dispatch('Excel.Application') an EXCEL.EXE process appears on the processes list (which view using the Windows Task Manager or subprocess.Popen('tasklist') ) as expected. I then do all the stuff I need to do no problem. However, when I close Excel: excelApp.Application.Quit() The process persists, even if I

Class not registered Error

痞子三分冷 提交于 2020-01-09 07:08:27
问题 Running an application from Visual Studio 2012 on 64-bit computers, displays the following error message: Retrieving the COM class factory for component with CLSID {F2D4F4E5-EEA1-46FF-A83B-A270C92DAE4B} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)) I am using Inventor packandgo dll library in visualstudio. Anyone know what is the error? 回答1: My problem and the solution I have a 32 bit third party dll which I have

Class not registered Error

我是研究僧i 提交于 2020-01-09 07:08:13
问题 Running an application from Visual Studio 2012 on 64-bit computers, displays the following error message: Retrieving the COM class factory for component with CLSID {F2D4F4E5-EEA1-46FF-A83B-A270C92DAE4B} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)) I am using Inventor packandgo dll library in visualstudio. Anyone know what is the error? 回答1: My problem and the solution I have a 32 bit third party dll which I have

Cannot get interface from different process via ROT

旧时模样 提交于 2020-01-07 07:01:18
问题 my app is an .exe, it registers itself to ROT. [ComVisible(true)] [ProgId("My.App")] public class MyApp { public Interop_MyApp.IXXX XXX { get { return XXXImpl.Instance; } // -> Instance is derived from Interop_MyApp.IXXX, and static } public MyApp() { } }; I start the .exe above, it's running. Then I start an other .exe, which tries to get the XXX. object o = Marshal.GetActiveObject("My.App"); // -> returns a __ComObject, fine if (o == null) throw new InvalidOperationException("Could not

Exceptions raised running COM DLL

懵懂的女人 提交于 2020-01-07 06:47:49
问题 I will try again .... :) If I have this code: void CTestDlg::OnBnClickedButtonTest() { MSAToolsLibrary::IMSAToolsLibraryInterfacePtr p; HRESULT hr; hr = p.CreateInstance(__uuidof(MSAToolsLibrary::MSAToolsLibraryClass)); if (FAILED(hr)) { __int64 i; p->SetPathXML(m_strPublisherDatabaseXML.AllocSysString(), &i); p->ReadPublisherData(&i); } } And I run it, I get this silent exception: Exception thrown at 0x00007FFCD00B7788 (KernelBase.dll) in Test.exe: 0x04242420 (parameters: 0x0000000031415927,