com

Property/Method Descriptions for COM Libraries

China☆狼群 提交于 2019-12-01 06:30:40
If you create a COMClass, I've noticed that the values in the XML Summary tag do not show in the object browser of VB6/VBA when you reference the resulting tlb file. Is there a way to have these values show up? Hans Passant No, 12 years of IntelliSense evolution prevents this from working. The XML documentation comments generates an .xml file that IntelliSense can pick up. In VB6/A, documentation is present in the type library with the helpstring attribute. For example: [ odl, uuid(2334D2B1-713E-11CF-8AE5-00AA00C00905), hidden, dual, nonextensible, oleautomation ] interface IVBDataObject :

What is the different between /n and /i parameters of RegSvr32.exe?

落爺英雄遲暮 提交于 2019-12-01 06:24:09
问题 To register a COM server, we run something like in elevated mode: regsvr32.exe com.dll To perform per-user registration, execute in user account: regsvr32.exe /n /i:user com.dll regsvr32.exe support these parameters: /u - Unregister server /i - Call DllInstall passing it an optional [cmdline]; when used with /u calls dll uninstall /n - do not call DllRegisterServer; this option must be used with /i /s – Silent; display no message boxes (added with Windows XP and Windows Vista) When create a

IE Com Object, Difference between methods .Navigate and .Navigate2

浪尽此生 提交于 2019-12-01 06:22:23
What is the difference between $ie.Navigate("URL") and $ie.Navigate2("URL") ? Get-Member says: Navigate Method void Navigate (string, Variant, Variant, Variant, Variant) Navigate2 Method void Navigate2 (Variant, Variant, Variant, Variant, Variant) Sample Code: $ie = New-Object -ComObject InternetExplorer.Application $ie.visible = $true $ie.Navigate("www.stackoverflow.com") #or $ie.Navigate2("www.stackoverflow.com") The difference is in the first argument URL . Here is what MSDN says: Navigate Method URL: A String expression that evaluates to the URL, full path, or Universal Naming Convention

AxAcroPDF swallowing keys, how to get it to stop?

一笑奈何 提交于 2019-12-01 06:19:17
问题 The AxAcroPDF swallows all key-related events as soon as it gets focus, including shortcuts, key presses, etc. I added a message filter, and it doesn't get any key-related messages either. It's a COM component, could that be relevant? Is there any way to catch these before the control starts swallowing them? 回答1: Hans is correct, the Acrobat Reader spawns two child AcroRd32 processes which you have no direct access to from within your managed code. I have experimented with this and you have

Why is VBA's VarType function saying this COM object is a string? (Object is instance of COM version of .NET's System.Object class.) Is it a bug?

萝らか妹 提交于 2019-12-01 06:03:58
Question summary When I use VBA's VarType function, passing it an instance of the Object class available in a mscorlib.dll library reference (a .NET library reference), the value returned is 8 . According to VBA documentation here , this means the object is a string. This seems ridiculous. My question is why is the VarType function returning a string-type value for instances of this Object class from the .NET-library VBA reference? Is it a bug? Background information I suspect that the fact that VBA's VarType function is saying a certain COM object is a string, may be why I'm having problems

C++: Convert wchar_t* to BSTR?

泪湿孤枕 提交于 2019-12-01 06:02:33
I'm trying to convert a wchar_t * to BSTR . #include <iostream> #include <atlstr.h> using namespace std; int main() { wchar_t* pwsz = L"foo"; BSTR bstr(pwsz); cout << SysStringLen(bstr) << endl; getchar(); } This prints 0 , which is less than what I'd hoped. What is the correct way to do this conversion? You need to use SysAllocString (and then SysFreeString). BSTR bstr = SysAllocString(pwsz); // ... SysFreeString(bstr); A BSTR is a managed string with the characters of the string prefixed by their length. SysAllocString allocates the correct amount of storage and set up the length and

Why isn't IUpdateSession::WebProxy working on Windows 10?

六眼飞鱼酱① 提交于 2019-12-01 06:02:00
问题 I've got some in-house code that performs a Microsoft Update scan using the Windows Update API. Because some of the clients do not have direct internet access, I explicitly set the WebProxy property to point to our local proxy server. During testing (on Windows 7) this seemed to work perfectly. Now I'm testing it on Windows 10 (see footnote 1) and it seems that the proxy setting is being ignored. The Windows Update client was revised significantly in Windows 10, so it is possible that this is

RPC_E_SERVERFAULT

夙愿已清 提交于 2019-12-01 06:01:50
In my asp.net application I am calling one com component method using Interop dll. This is working fine in normal condition but In production sometimes its throwing below exception System.Runtime.InteropServices.COMException (0x80010105): The server threw an exception. (Exception from HRESULT: 0x80010105 (RPC_E_SERVERFAULT)) I am suspecting that this is happening when large number of users are accessing same page simultaneously. Is somebody know solution or steps to debug this issue. I have another question. while searching on internet I came across this aspcompact attribute and MTA vs STA

COM Exception 80040154 When creating an Excel Application

末鹿安然 提交于 2019-12-01 05:52:18
I'm trying to run my application on a server which does not and will not have Office installed on it. using EXCEL = Microsoft.Office.Interop.Excel; ... EXCEL.Application app = new EXCEL.Application();//Exception thrown here The code is working fine on my own system, but on the server it gives the following exception: Unhandled Exception: System.Runtime.InteropServices.COMException: Retrieving the COM class factory for component with CLSID {...} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)). both systems are 32bits,

How to register COM from VS Setup project?

可紊 提交于 2019-12-01 05:47:31
问题 I have marked my DLL as vsdraCOM, and I can see it in the registry after installing, but my application does not see the COM interface until I call RegAsm on it manually. Why could this be? The COM registration does not work on Vista (confirmed myself) and on XP (confirmed by a colleague). Using Visual Studio 2005 on XP. 回答1: Well, I have found a solution: Run RegAsm.exe with the /regfile option to generate the registry entries. Manually import the .reg file into the VS Setup project by