com

Retrieving Outlook 'Inbox' and 'Sent' folders in Delphi using OLE

和自甴很熟 提交于 2019-12-05 19:31:16
What's the best way to go about extracting Outlook folders from within Delphi? Ideally I'd like to retrieve the Inbox folder and any other folders within it. I don't require the email headers/message just purely the folder names. Delphi BDS 2006 See here for Outlook's Object Model. Below displays the names of folders in the Inbox: procedure TForm1.Button1Click(Sender: TObject); var Outlook, oNameSpace, Inbox: OleVariant; i: Integer; begin try Outlook := GetActiveOleObject('Outlook.Application'); except Outlook := CreateOleObject('Outlook.Application'); end; oNameSpace := Outlook.GetNamespace(

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

狂风中的少年 提交于 2019-12-05 19:16:46
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 gave is here . Getting the HWND is as simple as: IntPtr hwnd = (IntPtr)IE.HWND; 来源: https://stackoverflow

how to connect to an open window of internet explorer using c#?

こ雲淡風輕ζ 提交于 2019-12-05 19:01:57
Can you use COM/OLE in a C# program to connect to a running instances of internet explorer? Ideally I'd like to find the URLs of all webpages open in IE. Evan I found the answer here and the code excerpt is: public class Form1 : System.Windows.Forms.Form { static private SHDocVw.ShellWindows shellWindows = new SHDocVw.ShellWindowsClass(); public Form1() { InitializeComponent(); foreach(SHDocVw.InternetExplorer ie in shellWindows) { MessageBox.Show("ie.Location:" + ie.LocationURL); ie.BeforeNavigate2 += new SHDocVw.DWebBrowserEvents2_BeforeNavigate2EventHandler(this.ie_BeforeNavigate2); } }

Allowed “out” parameter types in a COM automation interface

我与影子孤独终老i 提交于 2019-12-05 18:45:53
I'm implementing COM automation (dual interface) for an application. The automation interface will be called from VBScript. I'm not quite clear on what types are allowed for the method's arguments. I do know that basically values have to fit in a VARIANT , but does that mean every parameter of type int must be passed through a VARIANT , or can one pass int directly? For example, two methods I have in my MIDL file are: HRESULT SetDate([in] int Year, [in] int Month, [in] int Day); HRESULT GetDate([out] int* pYear, [out] int* pMonth, [out] int* pDay); Calling SetDate from VBScript works. Calling

Performance of passing data between .Net and COM assemblies

风格不统一 提交于 2019-12-05 18:41:55
I am in the process of migrating a legacy VB6 app to .Net, however since it is a high-profile business critical application, it is being done piece by piece. In the interest of improving performance, there is one method which gets hit a lot,thousands of times during the application life, and I was wanting to rewrite it in .Net (C#) to see if the runtime can be improved. The method in question manipulates ADODB Recordsets. Is there any performance issues I should be aware of or take into consideration since these recordsets will be passed to and from VB6 via COM interop? I haven't done anything

Convert c++ (DLL) project to COM DLL project [closed]

孤街醉人 提交于 2019-12-05 18:41:20
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center . Closed 7 years ago . Hi I have a pure C++ project (DLL) which I would like to convert to COM project, e.g. all public interfaces defined in headers, will now be exposed as COM interfaces (IDL etc...). And the final product should be COM Dll. How do I start? How do I define Any high level guidelines? good articles? There are at least

SideBySide Registration-Free COM fail while loading

廉价感情. 提交于 2019-12-05 18:36:32
i'm trying to create a C# COM Server which is used by a Delphi App without a COM-Registration. The process is descried on a ms blog - Registration-Free Activation of .NET-Based Components: A Walkthrough I created the necessarily manifest files and i linked them to the assemblies. The App Manifest: <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> <assemblyIdentity type="win32" name="Vorg" version="1.0.0.0" /> <dependency> <dependentAssembly> <assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls"

convert BSTR to LPCWSTR

允我心安 提交于 2019-12-05 18:21:31
Here is my need BSTR l_strArgs; LPCWSTR sth; //---- //--- OutputDebugStringW(sth); How to convert BSTR to LPCWSTR ? Is there any header only library that coverts any string type(microsoft) to LPCWSTR type ? Just cover NULL scenario and you're good to go BSTR l_strArgs; LPCWSTR sth = strArgs ? strArgs : L""; As you mentioned ATL in the tag, here is ATL-style one-liner: OutputDebugString(CString(l_strArgs)); or, to make sure you are staying in Unicode domain: OutputDebugStringW(CStringW(l_strArgs)); I just found this one BSTR l_strArgs; LPCWSTR sth; CString cs(_com_util::ConvertBSTRToString(l

C# - Good way to expose Nullable<T> to COM

拈花ヽ惹草 提交于 2019-12-05 18:07:50
问题 We are working on exposing an assembly to COM. Among other things, we frequency use nullable values such as long?, DateTime?, etc. These are generic types and can't be exposed to COM. What is a good substitute for these data types for COM? We have tried the following: //Original CustomerID property in class public long? CustomerID { get; set; } //Explicit COM interface long IComInterface.CustomerID { get { return CustomerID.GetValueOrDefault(); } set { CustomerID = value; } } The problem is,

COM returns type that does not implement any interface

孤街浪徒 提交于 2019-12-05 17:55:58
I need to automate some tasks in Adobe InDesign CS3 from a .NET 4.0 application. I've added a reference to the InDesign Type Library using the Add Reference dialog in Visual Studio. It genereates an interop assembly, which correctly includes all of the interfaces and types declared in the type library. I haven't installed any Adobe SDK, as the type library was available in Visual Studio without installing anything but Adobe InDesign CS3. The interesting types in the interop assembly for me right now is the interfaces _Application and Application , and the class ApplicationClass . Here is the