com

Is it possible to forward delegate through COM interop?

a 夏天 提交于 2019-12-06 09:41:38
问题 I have a class: public class A { public delegate void SetTextDel(string value); public void Test() { SetTextDel setText = someInterface.SetText; icom.Set(setText); } } [ComVisible(true), Guid("81C99F84-AA95-41A5-868E-62FAC8FAC263"), InterfaceType(ComInterfaceType.InterfaceIsDual)] public interface Icom { void Set(Delegate del); } [ComVisible(true)] [Guid("6DF6B926-8EB1-4333-827F-DD814B868097")] [ClassInterface(ClassInterfaceType.None)] [ComDefaultInterface(typeof(Icom))] public class B : Icom

COM “Server busy” dialog on MFC

笑着哭i 提交于 2019-12-06 09:33:42
I have MFC application that pops up a server busy dilaog that looks just like here: https://stackoverflow.com/questions/4968872/how-can-i-disable-the-ole-server-busy-dialog-in-a-c-sharp-app This app calls AfxOleInit(). http://support.microsoft.com/kb/248019 explains that i should do AfxOleGetMessageFilter()->SetMessagePendingDelay(nTimeout); to avoid getting the dialog. It also suggest that i use OleInitialize instead of AfxOleInit to suppress the dialog. Does this mean if i don't call AfxOleInit(), then i won't get the server busy dialog? I can't really test because without AfxOleInit(),

Printing in Duplexpage a word document

半世苍凉 提交于 2019-12-06 09:33:29
问题 I am trying to automate the task of printing two copies at double page of ~30 Word document (*.doc). I want to send the program converted to .exe (I plan it just for Windows computers) using py2exe. I know that I can manually check the options but I will not be able to do so on the 20 or so computer where it will be used, as well as I cannot install in this computers new software (That's why I want to convert it into .exe ). I copied this solution to print, but I can't adapt it to do what I

Component Object Model

别等时光非礼了梦想. 提交于 2019-12-06 09:12:28
问题 My question is directed towards developers who are familiar with COM. I am currently writing my college thesis which is partially about Microsoft COM. is COM still used today for purposes besides legacy code everyone says COM is obsolete. Why is the new Windows Runtime an 'enhanced' COM based API? What is meant by the word 'enhanced' are there any significant upsides to COM compared to .NET or vice versa any recommendations where to learn more about COM and .NET Interop and how exactly does

Can you call COM components from server side javascript?

一个人想着一个人 提交于 2019-12-06 09:04:39
Is it possible (using one of the server side implementations of javascript .. see http://www.nakedjavascript.com/getting-started-55 ) to instantiate a COM object and invoke methods on it? idobatter There is node-win32ole ( npm install win32ole ). That depends on which server-side implementation you’re using. When using ASP/JS (or any other framework using Microsoft’s Windows Scripting engine), that’s not a problem using the ActiveXObject constructor. When using JSDB , you can use the ActiveX constructor. Node.js doesn’t really work on Windows, only thru Cygwin, so ActiveX probably won’t be

What's the correct way to use win32inet.WinHttpGetProxyForUrl

若如初见. 提交于 2019-12-06 09:03:40
问题 I'm trying to use a feature of the Microsoft WinHttp library that has been exposed by the developers of Win32com. Unfortunately most of the library does not seem to be documented and there are no example of the correct way to use the win32inet features via the win32com library. This is what I have so far: import win32inet hinternet = win32inet.InternetOpen("foo 1.0", 0, "", "", 0) # Does not work!!! proxy = win32inet.WinHttpGetProxyForUrl( hinternet, u"http://www.foo.com", 0 ) As you can see,

How to import a tlb and a namespace in c++ at runtime when some condition meets?

China☆狼群 提交于 2019-12-06 08:59:09
Generally we import a tlb file at the starting of the program like #include < stdio.h > #import " sql.tlb " But i need to import a tlb file when certain condition meets in the middle of the program how can i do this. to load dll there is LoadLibrary() but to load tlb can i use LoadLibrary() . Since tlb is generated by using .dll? You can load a type library at runtime using LoadTypeLib . ITypeLib *ptlib; LoadTypeLib("sql.tlb", &ptlib); What you do then with ptlib is kind of up in the air as you don't really say what you are trying to do with it. ptlib is an object supporting the ITypeLib

How exactly do I config DCOM to load my DLL into a separate process?

∥☆過路亽.° 提交于 2019-12-06 08:47:50
问题 I'm trying to force an existing native C++ ATL in-proc COM server into a separate process. I hope DCOM can do this for me without changing the COM server. I started with a usual registry setup - I have a HKCR\CLSID{classId} entry and an InProcServer32 key there specifying the path to the .dll file. I generated an application id (GUID) and added it here and there. Specifically I added a string value "AppId" under HKCR\CLSID{classId} equal to the application id. I also added a HKCR\AppId

C# Visual Studio: How to have multiple developers on a solution that references Office?

China☆狼群 提交于 2019-12-06 08:33:26
问题 When I add a reference to Office COM Library, I to go: References Add Reference Select the COM tab Select Microsoft Office 12.0 Object Library And magically named reference appears: Microsoft.Office.Core The Project.csproj file shows the details of the reference: <COMReference Include="Microsoft.Office.Core"> <Guid>{2DF8D04C-5BFA-101B-BDE5-00AA0044DE52}</Guid> <VersionMajor>2</VersionMajor> <VersionMinor>4</VersionMinor> <Lcid>0</Lcid> <WrapperTool>primary</WrapperTool> <Isolated>False<

How do I install and consume a COM object in Windows Azure?

天涯浪子 提交于 2019-12-06 08:22:53
问题 I have a lot of 32-bit C++ code that I want to run in Windows Azure Compute Service. The code is already packaged into a COM server and so I'd like to consume that server from managed code that will service external requests. I googled but can't find any details on how to deploy a COM server under Windows Azure. How do I do that? Is there a guide? What limitations are there? 回答1: I think you could deploy the COM objects as binaries and then register them using a startup script - see http:/