com

Problems with naming(lowercase/uppercase) when exporting COM component from C#

扶醉桌前 提交于 2020-01-02 19:12:29
问题 I have a C# COM DLL that defines some interfaces/types that I use from a C++ ATL/COM server. From time to time, be it on my machine, or randomly on other machines where I build the same projects (the ATL *.exe and the C# DLL) I get different compile errors related to exported C# struct members that are part of the COM interface. Here is an example: public enum TemporaryPolicyType { UntilTime = 0, ForNextMinutes } [Guid("6F8CD968-DA76-44CA-B4E1-C495AB5003BD")] public struct TemporaryPolicyData

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

爱⌒轻易说出口 提交于 2020-01-02 18:34:33
问题 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? 回答1: 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

How can I find out about undocumented .NET / COM library functions?

我们两清 提交于 2020-01-02 11:05:14
问题 How can I find out the properties and methods of COM objects returned from some .NET functions, which do not appear to be documented? In the particular example I'm looking at, I'm inserting a picture into Excel using a function like: Set NewPic = ActiveSheet.Pictures.Insert(FileName) (See the SO post on this here.) However, the MSDN documentation for this function only says that Worksheet.Pictures returns an Object, and when I put a watch on the variable during debugging its type is System._

C# Proper Way to Close Multiple Excel Objects With Excel Process Destroyed

半腔热情 提交于 2020-01-02 08:18:30
问题 I have a C# console program. When it runs, it instantiates some Excel objects such as: (openExcelO). When the program is done running, I have a method to close down Excel (closeExcel) and that is supposed to properly clean up the Excel process. In task manager I can see the remnants of Excel that remain. The shut down routines were cobbled together from internet examples: private void openExcelO (string dir) { try { xlApp = new Excel.Application(); xlWorkBook = xlApp.Workbooks.Open(dir +

iTunes COM interface on OS/X

谁说我不能喝 提交于 2020-01-02 07:45:29
问题 Is the iTunes COM interface available on Mac OS/X? From the documentation I could find, it seems much more extensive than the Applescript interface I could expose through the Automator program. Disclaimer : absolute OS/X newbie here. 回答1: The COM interface is windows-only. For seeing what Applescript capabilities an application like iTunes has, you probably want to use the low-level AppleScript Editor utility, instead of Automator . The Open Dictionary... menu command in AppleScript Editor

Loading all COM types of Excel dynamically?

爱⌒轻易说出口 提交于 2020-01-02 07:40:13
问题 I want to explore this path of working with Excel dynamically. I want to use Excel in my C# application without including dlls and stuff. I would just check first if the required Excel version is installed and run it. First I want to get all the types I need but I can't get hold of them: // works Type typeExcel = Type.GetTypeFromProgID("Excel.Application"); object excel = Activator.CreateInstance(typeExcel); object workbooks = typeExcel.InvokeMember("Workbooks", BindingFlags.GetProperty, null

How to get a reference to Internet Explorer's window handle in .net

假装没事ソ 提交于 2020-01-02 07:20:23
问题 Basically I am trying to get the HWND of an instance of Internet Explorer that I have been automating in C#. SHDocVw.InternetExplorer IE = new SHDocVw.InternetExplorer(); IE.AddressBar = false; IE.MenuBar = false; IE.OnQuit += IE_OnQuit; IE.Visible = true; IE.Navigate2("www.bing.com"); I would like to get a reference to it's window handle for further manipulation, however the only example of how to do this is in C++ and I am not sure how to do something similar in C#. The Example the msdn

Iterating over Word Document Fields using ComAutomationFactory in Silverlight 4

会有一股神秘感。 提交于 2020-01-02 06:27:10
问题 Update : This is a confirmed bug in Silverlight 4 beta. http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=523052 I solved this issue by switching to a full blown WPF application and using regular old Microsoft.Office.Interop.Word. But I'm still very interested in how to get this to work using the dynamic values from ComAutomationFactory. This may be more of a C# 4.0 question, but what I'm trying to do is leverage the ComAutomationFactory class in a trusted SL4

Is it possible to use registration-free COM with HTA applications?

半世苍凉 提交于 2020-01-02 05:27:10
问题 Since HTA applications are hosted within MSHTA.exe how does one provide a manifest? Plus I assume providing a MSHTA.exe.manifest could potentially break other HTA apps? 回答1: On Vista+, MSHTA.exe has an embedded manifest, which takes priority over external manifests, so your suggestion is not an option. On XP/2003, yes, your suggestion would work, although it would be bad form, as is dropping files in System32 to modify the behavior of a system binary (especially make sure that any

pass adoconnection from vba to delphi

▼魔方 西西 提交于 2020-01-02 04:54:19
问题 I'm looking to create a COM object in a VBA macro and then pass it to a Delphi DLL (D2009). What should my procedure declaration in Delphi look like? Background: I'm expecting (hoping) the VBA macro to: create the COM object, invoke the Delphi DLL, pass the COM object to the Delphi DLL procedure, stay alive until the Delphi DLL closes itself (the DLL will have embedded forms for the user to interact with). I think I'll need to create a callback function to let the VBA macro know that I'm done