com

Classic ASP using C# .net DLL Object doesn't support this property or method

走远了吗. 提交于 2019-12-06 04:41:31
Hey all this is my first time creating a COM object for a classic asp page. The process I followed when creating this COM DLL is this: 1) Used the Strong Name Tool (sn.exe) and placed the .snk file within the app. (sn -k myKey.snk) 2) Added: [assembly: AssemblyKeyFile(@"myKey.snk")] [assembly: ComVisible(true)] to the AssemblyInfo.cs. I do get a warning on the KeyFile saying: Use command line option '/keyfile' or appropriate project settings instead of 'AssemblyKeyFile' 3) Ran the following from the Administrator: SDK Command Prompt: tlbexp c:\\temp\\dll\\classicASPWSEnDecrypt.dll /out:c:\

How to get access to WriteableBitmap.PixelBuffer pixels with C++?

本秂侑毒 提交于 2019-12-06 04:37:33
问题 There are a lot of samples for C#, but only some code snippets for C++ on MSDN. I have put it together and I think it will work, but I am not sure if I am releasing all the COM references I have to. 回答1: Your code is correct--the reference count on the IBufferByteAccess interface of *buffer is incremented by the call to QueryInterface , and you must call Release once to release that reference. However, if you use ComPtr<T> , this becomes much simpler--with ComPtr<T> , you cannot call any of

activex in winform

我怕爱的太早我们不能终老 提交于 2019-12-06 04:35:36
I need to put some activeX in my .Net WinForm. The provider had sent me a .tlb and the com .dll. Is this enough? How do I put it on winform? That should be sufficent. You'll need to register that dll on your machine, add it to the dev studio Toolbox (Right click on the toolbox/Choose Items) and go to the COM tab, if you can't find it in there you can browse to the specific location and select the Type Library to use. After that you can just drag the new control to your form. A Reference to the library will be added to your project automatically. see " Adding ActiveX Controls to Windows Forms "

How to import and use a unmanaged C++ class from C#?

孤街醉人 提交于 2019-12-06 04:30:22
I have an native C++ dll, some header files and the import library. Is there a way how to instantiate an object within C# that is defined in the dll? The two ways I'm aware of are: to wrap the C++ code into COM to use DLLImport and external C functions C++/CLI is your friend for this. You'll run into one problem though: it is not possible to store standard C++ objects inside C++/CLI ref or value classes (the ones for .NET). So you'll have to resort to the following class (that you can modify) that I use in production code: #pragma once #include <boost/shared_ptr.hpp> template <typename T> ref

Register a proxy/stub in HKEY_CURRENT_USER

瘦欲@ 提交于 2019-12-06 04:28:42
The MIDL compiler generates code for a proxy/stub with registration routines that write to HKEY_LOCAL_MACHINE. Is there any way (preferably without hacking the MIDL-generated code and without bypassing all that generated code in favor of custom code) to register a MIDL-generated p/s in HKEY_CURRENT_USER? Also: Will this work if both the p/s and the COM server are registered per-user like this? I just found (after a very frustrating 48 hours) that a p/s registered machine-wide will not work correctly if the COM server is registered per-user. Specifically, the asynchronous call logic

COM Objects C# Casting MMDeviceEnumerator to IMMDeviceEnumerator InvalidCastException

 ̄綄美尐妖づ 提交于 2019-12-06 04:27:58
问题 I have no experience with COM Imports and am just working with someone else's code that wasn't working for me The line of code that is throwing the InvalidCastException: IMMDeviceEnumerator deviceEnumerator = (IMMDeviceEnumerator)(new MMDeviceEnumerator()); COM Imports: [Guid("BCDE0395-E52F-467C-8E3D-C4579291692E")] internal class MMDeviceEnumerator { } [Guid("A95664D2-9614-4F35-A746-DE8DB63617E6"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] internal interface IMMDeviceEnumerator {

Replacing a C++ ActiveX component with a .NET implementation?

浪尽此生 提交于 2019-12-06 04:24:33
问题 I have existing managed and unmanaged software using an ActiveX component supplied by a third party to perform some communications, but it is now required that this communication be routed through my application. Ideally I'd be able to install a .NET component which will expose exactly the same interface, and will be usable as a drop-in replacement. However, I am running into the limits of my understanding of COM, which admittedly is quite minimal. How best to ensure that my implementation of

DocumentComplete is firing before page is fully loaded

血红的双手。 提交于 2019-12-06 04:17:29
Why does DocumentComplete event of WebBrowser COM object fire before page is loaded? I thought that this event is only fired when page is fully rendered in browser's window. this is my BHO implementation: [ComVisible(true), Guid("5a954357-44bd-4660-9570-17bb1b71eeaa"), ClassInterface(ClassInterfaceType.None)] public class BHO : IObjectWithSite { private WebBrowser browser; private DateTime startTime; private DateTime endTime; private object _pUnkSite; public void OnDocumentComplete(object pDisp, ref object URL) { if (!ReferenceEquals(pDisp, _pUnkSite)) { return; } using (StreamWriter sw = File

Add ATL Simple Object in Visual Studio 2017

廉价感情. 提交于 2019-12-06 04:16:34
问题 I am working with an old ATL/COM project in Visual Studio 2017. In previous versions of Visual Studio you could select "Add Class" and then select the option "Add simple ATL object" to add a COM class to the project. This option appears to be completely missing in Visual Studio 2017. Has the option been moved? Have I missed an installation option? Does Visual Studio fail to recognize my project as an ATL project? (It was created with a much older version.) Or is this the end of the road for

How to make COM ActiveX object work in IE 64 bit?

我与影子孤独终老i 提交于 2019-12-06 04:14:47
I have a COM object embeded in ASP.NET page using <object classid="clsid:XXX..."> . It works in IE 32 bit, but does not work in IE 64 bit - can't access its functions. There are no error messages, no event logs where I can get some information. The dll is in C#, includes COM visible class, compiled for Any CPU (though I also tried x86), and registered during client installation by executing regasm. This creates registry keys, well everything works fine except for IE 64. I searched internet about the issue or at least some guidlines and didn't find anything. I received an answer on another