com-interop

Winforms Flickering While Drawing Image on Taskbar

China☆狼群 提交于 2019-12-12 01:39:54
问题 Right now I'm drawing a small 16x16 image on the title bar of my window. It works nicely, except for an obnoxious flicker that I cant figure out how to get rid of. I'm simply drawing the image like this: Protected Overrides Sub WndProc(ByRef m As Message) If m.Msg = WM_SIZE Then wnd_size = New Size(New Point(CInt(m.LParam))) End If If m.Msg = WM_ACTIVATE _ OrElse m.Msg = WM_SIZE _ OrElse m.Msg = WM_SYNCPAINT _ OrElse m.Msg = WM_NCACTIVATE _ OrElse m.Msg = WM_NCCREATE _ OrElse m.Msg = WM

SetWinEventHook crahes IE when used in BHO (Browser Helper Object)

主宰稳场 提交于 2019-12-11 17:39:52
问题 I have a C# BHO which sets a hook so that I can track when IE gets focus: public class BHO : IObjectWithSite, IOleCommandTarget { delegate void WinEventDelegate(IntPtr hWinEventHook, uint eventType, IntPtr hwnd, int idObject, int idChild, uint dwEventThread, uint dwmsEventTime); const uint WINEVENT_OUTOFCONTEXT = 0; const uint EVENT_SYSTEM_FOREGROUND = 3; [DllImport("user32.dll")] static extern bool UnhookWinEvent(IntPtr hWinEventHook); [DllImport("user32.dll")] static extern IntPtr

COM Interop Through Wine in OSX

爷,独闯天下 提交于 2019-12-11 17:27:04
问题 I am trying to write a program that modifies Office files (word, excel) programmatically using C#. Before continuing with my project, I would like to know if the COM Interop can be used in OSX by utilizing Wine, and if so, can this be done in Linux as well? 来源: https://stackoverflow.com/questions/23532327/com-interop-through-wine-in-osx

Serialize a COM object to JSON?

别来无恙 提交于 2019-12-11 15:43:50
问题 I have set a reference in C# code to a COM DLL (compiled from VB6). I am trying to serialize a COM object from a type in that DLL using JSON.NET (NewtonSoft). Code that I've tried so far: var settings = new JsonSerializerSettings { Formatting = Formatting.Indented, }; var serializer = JsonSerializer.Create(settings); using (var gz = new GZipStream(File.OpenWrite(filespec), CompressionMode.Compress)) using (var sw = new StreamWriter(gz)) using (var writer = new JsonTextWriter(sw)) { serializer

How do I make COM Surrogate Multiple Instance?

十年热恋 提交于 2019-12-11 15:28:34
问题 I have a C# 32-bit COM DLL that talks to a C# 64-bit exe using the 'DllSurrogate' method described in Hosting a .NET DLL as an Out-Of-Process COM Server (EXE). I need this setup because the 32 bit C# talks to a legacy 32-bit C++ dll. I thought everything was working fine, but I have just realised that when you create a second instance of the 64-bit exe you do not get a second "DLL Host" (COM Surrogate) process. This is no good for my application. This is a Windows Desktop application and I

HTTP Status 443 on Server.CreateObject in VBScript under Classic ASP IIS 6.0

岁酱吖の 提交于 2019-12-11 13:56:47
问题 This is old legacy code that has been running at least 5 years. The DLL happens to relate to Paypal's PayFlowPro merchant processing service, but I think this is a Windows scenario causing the issue. Suddenly, based on the code below, I'm seeing this error in the browser: > Error with new credit card processing software, please call Neal at xxx-xxx-xxxx > Error Ref102: client = Server.CreateObject returned Null > (Detailed error: Object doesn't support this property or method) > (Detailed

Is there a way to pass an OCX control reference out from a Visual Basic 6 activeX dll via COM interop?

孤者浪人 提交于 2019-12-11 11:55:13
问题 I stumbled upon this while trying to build an ActiveX dll from an old (but still maintained) VB6 exe project (*) sources in order to perform some testing via COM / NET interop. The (desired) use case is: Take a VB6 class with public methods taking or returning some control (for example CommonDialog ) reference Compile this class into an ActiveX dll Create an instance of this class via COM interop from .NET and correctly call its methods In short, the first problem is that having something

Unspecified error (Exception from HRESULT: 0x80004005 (E_FAIL)) on Microsoft.Office.Interop.Excel.ChartObject.Copy

拥有回忆 提交于 2019-12-11 11:53:44
问题 i am working with Microsoft.Office.Interop.Excel, to copy excel chart into power point using Asp.net. It works fine in visual stdio IDE but as i I deploy it on server. it gives an error , Unspecified error (Exception from HRESULT: 0x80004005 (E_FAIL)) this erorr generted by code when it copies the charobject ,Only data copies perfectly fine. problem is with chartobject.copy() function. I googled alot but it gives nothing please help me. Moazzam 回答1: Office interop is NOT supported by MS in

Returned managed object method not called from C++ in COM interop

自闭症网瘾萝莉.ら 提交于 2019-12-11 11:47:36
问题 This is a follow up from my previous post. Read that post for context. Note that it is not strict COM interop - but the C++ interfaces are COM compatible. Im trying to implement this C++ interface in C# class IPluginFactory : public FUnknown { virtual tresult PLUGIN_API createInstance (FIDString cid, FIDString iid, void** obj) = 0; }; My C# code looks like this: [ComImport] [Guid(Interfaces.IPluginFactory)] [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] public interface IPluginFactory

Easiest way to make .NET DLL visible to COM?

喜你入骨 提交于 2019-12-11 11:01:27
问题 I have a proprietary .NET DLL which I would like to use in a COM client. Currently when I use regasm it says: warning RA0000 : No types were registered Since I don't have the source code I can't set the classes to ComVisible or whatever else is required. How can I easily make this DLL visible to COM ? 回答1: You need to write a "COM callable wrapper". Here are a few links: http://msdn.microsoft.com/en-us/library/ms973802.aspx http://msdn.microsoft.com/en-us/library/f07c8z1c.aspx http://edn