com

Does order matter when registering, gac-ing assemblies for COM interop?

こ雲淡風輕ζ 提交于 2019-12-05 11:29:58
When registering .NET assemblies for COM Interop, I do two things, currently in this order: regasm /tlb:MyDll.tlb Mydll.dll gacutil /i Mydll.dll I use regasm to register the type library for COM and gacutil to install the assembly into the GAC. Does it matter which order I do these two actions? Also, as I make updates to my dll, do I need to un-register and re-register it, uninstall it from the gac and re-install it, both or neither? Does order matter? No. Do you need to reinstall in GAC when the dll has changed? Yes. Do you need to re-register for COM when dll has changed? That depends. If

Best way to call .NET classes from PHP?

末鹿安然 提交于 2019-12-05 11:15:05
What are the best options for connecting PHP apps to logic located in .NET libraries? PHP, since v5.0, supports a DOTNET class that is supposed to let me invoke .NET logic from a PHP script. But it seems there are many problems - I've not been able to get it to work reliably, with arbitrary .NET classes. The doc is sort of slim and what is documented isn't really correct. The questions on the internets on this class are many, as are the bug reports on php.net. I have been able to get PHP to connect with .NET via COM interop - but this requires that the .NET class be ComVisible. And as far as I

How do I use _com_ptr_t?

核能气质少年 提交于 2019-12-05 11:08:26
Say I have a class that owns a D3DDevice : class Thing { public: Thing() { D3D11CreateDevice(..., &device, ...); } ~Thing() { device->Release(); } private: ID3D11Device* device; }; From what I understand, I can use _com_ptr_t to ensure that the object gets deleted without my having to explicitly call Release() in the destructor. The problem though is that I can't figure out the correct syntax for the template. I could find hardly any information on _com_ptr_t , and the closest thing I could find to an answer was this (Japanese) one . Following the syntax there, I get a bunch of compiler errors

How do I return an array of strings from an ActiveX object to JScript

﹥>﹥吖頭↗ 提交于 2019-12-05 10:43:09
I need to call into a Win32 API to get a series of strings, and I would like to return an array of those strings to JavaScript. This is for script that runs on local machine for administration scripts, not for the web browser. My IDL file for the COM object has the interface that I am calling into as: HRESULT GetArrayOfStrings([out, retval] SAFEARRAY(BSTR) * rgBstrStringArray); The function returns correctly, but the strings are getting 'lost' when they are being assigned to a variable in JavaScript. The question is: What is the proper way to get the array of strings returned to a JavaScript

COM Interop, RPC server is unavailable in c#

孤街醉人 提交于 2019-12-05 10:31:02
I am using a COM Interop and i am instantiating the COM class object from the interop dll So, few times the object is instantiated successfully and make remote procedure calls without any problem but sometimes it throws an exception like RPC Server is unavilable. The COM Component i am using is written in VB and i am consuming that component in c#. So, can anybody tell me the possible reasons for the problem(RPC Server is Unavailable) and solutions to this problem. I am helpless with this issue by now. So, Advance thanks if you can help me out After reviewing my approach for COM implementation

Diagnosing an app that fails to halt

女生的网名这么多〃 提交于 2019-12-05 10:27:30
Our Windows app is often hanging in memory and I'm trying to use windbg to track down the problem. I'm very new to windbg and could use some advice (I have started to read Advanced Windows Debugging though). The app is a mix of C++ and COM objects written in VB. Occasionally when you exit, the app appears to go away but task manager shows it hanging around in memory, apparently idle. !threads shows me this: ThreadCount: 2 UnstartedThread: 0 BackgroundThread: 2 PendingThread: 0 DeadThread: 0 Hosted Runtime: no PreEmptive GC Alloc Lock ID OSID ThreadOBJ State GC Context Domain Count APT

C# Com Interop with Windows Media Player Visualisation (With Sample Code)

旧城冷巷雨未停 提交于 2019-12-05 10:12:44
I am attempting to create a Windows Media Player (WMP) Visualization plugin in C#. I am quite new to exposing C# to COM and may have missed something basic. I have persisted with this for 3 days (about 20 hours) and not got past the single issue I will describe below. For those who don't know, WMP visualizations are the pretty images that show in media player while listening to music. In a nutshell : WMP will call certain methods on my C# COM interface, but not others. I have WMP 11 installed I downloaded the Latest Windows SDK which contains a C++ plugin wizard to compile a working

Shall we treat BSTR type in COM as value or reference?

泄露秘密 提交于 2019-12-05 10:04:49
From book ATL Internals , I knew BSTR is different from OLECHAR*, and there are CComBSTR and CString for BSTR. According MSDN Allocating and Releasing Memory for a BSTR , I knew memory management responsibility for caller/callee. Take this line from MSDN, HRESULT CMyWebBrowser::put_StatusText(BSTR bstr) I still do not know how to handle bstr properly in my implementation. Since I still have a basic question for BSTR -- should we treat bstr as a value (like int) or as a reference (like int*), at least on COM interface boundary. I want to convert BSTR as soon as possible to CString/CComBSTR in

The type library importer encountered an error during type verification

删除回忆录丶 提交于 2019-12-05 09:27:27
I am writing a C# application which has several COM references. When I attempt to build it I get the following error for some of them: c:\WINDOWS\Microsoft.NET\Framework\v3.5\Microsoft.Common.targets(1418,9): error MSB3303: Could not resolve COM reference "70850f66-869f-44a0-88e7-b0460a7e3bf3" version 0.1. The type library importer encountered an error during type verification. Try importing without class members. The application is still built and runs successfully. What does this error message mean, and how can I fix it? By running TlbImp myself on the offending files I was able to determine

What does RtlInitializeExceptionChain do, and how can I reduce its execution overhead?

混江龙づ霸主 提交于 2019-12-05 09:26:51
问题 I am trying to find bottlenecks in my program (currently in the "low-hanging fruit" stage), and using a profiler I get something like the following: The thing I see in this is that RtlInitializeExceptionChain takes up the far majority of the time, and functions from my actual program don't even make it onto this top list. I would like to know if anyone knows what RtlInitializeExceptionChain does, how it is called, and how I can reorganize my program to not call it so much? Some other