I've gone through the magic-eye and slipstick and microsoft tutorials on extending office applications, but I am none the wiser, and hoping someone here can point me in the right direction. How do I add a menu-option to (say) the Tools menu in Outlook? I know: * Its a COM Add-in thing * I'm using an IDT2Extensibility * I have to do it in the OnConnection event that is fired I have found examples and plenty of information about adding buttons, but I really want to add a menu option - either within the Tools menu or via a new top level menu.
Adrian Hall
Posts
-
Outlook COM Add-in HOW-TO? -
Stream Socket + SSL ClassBefore I go re-inventing the wheel, can anyone tell me if they have an SSL Stream Socket class? I already use TCP based cleartext socket communications to a server and want to enable SSL support for the same protocol going through an SSL proxy.
-
Basic Auth for ASP.NETYes - I have that piece working - wanted to know if I could do Basic Auth though since I am replacing an app. that has Basic Auth already. -Adrian
-
More ActiveDirectory --- Binding as a DN?Hey all, I'm working on an Active Directory web application. I've gotten further than my prior post - if you read my prior post, basically, the problem is this - I have to bind to the LDAP directory as a specific DN to authenticate (the username/password route for AD is not good enough since we are dealing with a non-MS ldap server). The process is this: * bind as an anonymous user * search with a filter of your own devising * obtain a single directoryentry object * bind to this directoryentry with the provided password This seemed like an easy thing to do initially - after all, we do have System.DirectoryServices --- the actual process was a little more involved. I've done the first three and got them working now (see below for the code). I'm now at step 4 - how do I bind to the directory using an existing DirectoryEntry and a password? My first thought was:
DirectoryEntry bound = new DirectoryEntry(me.Path, "", password, AuthenticationTypes.ServerBind);
... but that does not seem to work (i.e. it always returns) - how can I tell if the binding was successful? Code to get to this point:// // Create the base path for the authentication. // string path = _host + "/" + _basedn; DirectoryEntry entry = new DirectoryEntry(path); // // Construct the filter necessary to search the // specified LDAP directory structure // Regex r = new Regex(Regex.Escape("$(login)")); string filter = r.Replace(_filter, username); // // Search for our user // DirectorySearcher dsrch = new DirectorySearcher(entry); dsrch.Filter = filter; dsrch.SizeLimit = 2; SearchResultCollection results = dsrch.FindAll(); // // Check to see if we found the user // if (results.Count == 0) return false; if (results.Count > 1) throw new Exception("Invalid user ID in LDAP Directory"); // // Convert the result into a DirectoryEntry // DirectoryEntry me = results[0].GetDirectoryEntry();
-Adrian -
ActiveDirectory / LDAP SearchingAfter much searching, I found there is a difference between ldap:// and LDAP:// --- go figure.
-
Basic Auth for ASP.NETI need to present one of those nice Authentication boxes to get a Username and Password and then 'do something' with the info - think of it as Windows authentication, but using my own authenticator instead of checking against the Windows database. Now, my thinking is that in the Page_Load() function, I can take a look to see if the Basic Auth token is there, and if it isn't, return the challenge. If it is there, I can test it and allow the username/password through to the page if its ok. Page_Load() may not be the best place for it - perhaps Session_Start()? Does anyone have code for this? -Adrian
-
ActiveDirectory / LDAP SearchingI have a requirement to authenticate users against a non-MS LDAP service using non-standard attributes. The general method of doing this is to search for the user anonymously, then re-bind to the server with the found DN and the provided password. I'm using the following code to implement the search, but it always fails (error provided below):
DirectoryEntry me; string filter = "(mailLocalAddress=" + uid + ")"; string path = "ldap://10.10.240.19/o=Top"; DirectoryEntry dbE = new DirectoryEntry(path); DirectorySearcher dsE = new DirectorySearcher(dbE, filter); dsE.SizeLimit = 2; SearchResultCollection src = dsE.FindAll(); if (src.Count == 0) { throw new AuthenticationException("Login Incorrect"); } if (src.Count > 1) { throw new AuthenticationException("Invalid LDAP Response"); } me = src[0].GetDirectoryEntry();
The error I get is:System.Runtime.InteropServices.COMException (0x80040E37): Unknown error (0x80040e37) at System.DirectoryServices.DirectoryEntry.Bind(Boolean throwIfFail) at System.DirectoryServices.DirectoryEntry.Bind() at System.DirectoryServices.DirectoryEntry.get_AdsObject() at System.DirectoryServices.DirectorySearcher.FindAll(Boolean findMoreThanOne) at System.DirectoryServices.DirectorySearcher.FindAll() at Portal.Login.CheckPassword(String uid, String pass) in c:\inetpub\wwwroot\portal\login.aspx.cs:line 108
Now, my base DN is indeed "top". What I am expecting is that the program binds anonymously to the specified LDAP server and does a sub-tree search on o=Top for my filter. Anyone have any ideas? -Adrian -
Basic Auth in ASP.NET?I need to present one of those nice Authentication boxes to get a Username and Password and then 'do something' with the info - think of it as Windows authentication, but using my own authenticator instead of the Windows one. Now, my thinking is that in the Page_Load() function, I can take a look to see if the Basic Auth token is there, and if it isn't, return the challenge. If it is there, I can test it and allow the username/password through to the page if its ok. Does anyone have code for this? -Adrian
-
How di I add a "Send To..." itemI thought so too - however, the article pointed to shows you how to add a "Send To" menu item to your own application, not how to add a menu item to the "Send To" menu. -Adrian
-
How di I add a "Send To..." itemI'm sure this is totally documented and I am just looking / searching for the wrong things here - if some kind soul can point me to the right documentation, then I'm sure I can work it out for myself. I want to add a new element to the Windows Explorer "Send To..." - call it "Send To->Webmail Recipient" - what it will do is parcel up the files that have been highlighted and present a (C#) form that will ask for a recipient and then send those files via my webmail system to the recipient. Can someone point me in the right direction? -Adrian
-
(Suggestion): Database comparisonYou might try this link. http://www-3.ibm.com/software/data/pubs/pdfs/bloor.pdf[^] I'm not suggesting it isn't biased (lets face it, a database vendor paid for it), but it does have a wide variety of information in it. At 150 odd pages, its a hefty read. (Perhaps this is why no-one takes up the challenge - a comparison of databases is not a trivial thing). -Adrian
-
How to write configuration files?How are you getting the data sent to Linux? How often is it going to get sent? What programming languages can you program in? For myself, I know PHP and Perl, which generally do admirably for small jobs which are not long running. However, PHP requires a web server, and Perl requires a fairly significant runtime loaded, so it can be a pain. C or C++ with the SOAP libraries are also an option. I wouldn't go with Java simply because the java implementation on Linux has reliability issues (in my experience, which is limited since I had other options rather than Linux open to me, so I never pursued my issues). -Adrian
-
hotmail.com database?(Disclaimer: I work for a company producing email products, but I have no insider knowledge of hotmail.com beyond what I have read and heard over the years). I'm not sure hotmail.com uses a database in the traditional sense of "database" beyond the Passport authentication. The messages are likely to be held in flat files. Email systems just don't work the same way as databases in general. Even the now defunct Internet Mail Service from Microsoft held each message in a single RFC-822 formatted file, with an index file for the meta-data. However, a quick look at the SMTP servers indicate that they are now running Microsoft stuff on at least some of their servers (It looks like Exchange 2K), and their web servers are running IIS, so I guess that they are running Microsoft stuff now. It should be noted that on an Exchange 2K server (at least my Exchange 2K server), I can change directory to M:\sitename\MBX\ahall\INBOX and see a series of file .EML. If I connect to the IMAP port, then I see appear as an IMAP UID. .EML format is the same RFC-822 format that their defunct Internet Mail Service saved data as. So even in Exchange 2K, the database functionality is seriously limited. -Adrian
-
mySQL, what do you think?Thats a good question. Since I am a consultant by day and programmer by night, I'll put my consultant hat on for you. For small deployments, it really doesn't matter what you choose. I would recommend SQL Server simply because of the ease of deployment. For larger deployments, where performance becomes an issue (and this point is dependent on the application and the environment), I tend to recommend Oracle. For web deployments where the data is not as critical, or other programming languages (such as PHP or Perl) need to get involved, I tend to recommend MySQL. I say "tend to" since I sometimes come across sites which already have a database in place, and that would have a bearing on the overall cost of the solution. -Adrian
-
mySQL, what do you think?Disclaimer: Although I use MySQL, I have not used MySQL with C# That being said, MySQL does have an ODBC driver at www.mysql.com and there is a supported version (via MySQL AB) although you will have to ask for a quote, since in a corporate edition, this can get quite pricy. ... and my experience with C# and ODBC is quite good. Regards, Adrian
-
COM Interop (still confused)Im still confused and going round in circles with this stuff. Bear with me as I explain what I have done and am doing. What I am attempting to do is write a "quick and dirty" MAPI Service Provider to implement a mail sender that posts via an XML interface over HTTP. The XML interface over HTTP bit is working already. Now, my thought was "Well, .NET does XML nicely so I don't have to get dirty with that stuff", and so I decided to learn what was involved in writing a service provider. Step 1: Read all about it - In this case, this meant digging up a copy of "Inside MAPI", which is apparently the only book on writing service providers. I tried going through the MSDN collection, but - quite frankly - in this area, it sucks (altho I did come across an article saying "MAPI isn't dead yet", which is heartening). Now, in reading, I learnt that I needed to do the following: - Code a Windows DLL with implements ServiceEntry() and XPProviderInit() and three COM interfaces (IXPProvider, IXPLogon and IMAPIStatus, all of which seem to inherit IUnknown). I figured here that ServiceEntry() and XPProviderInit() will have to be in some class - probably the "default" class, if such a beast exists - since these will kick off Windows Forms for configuration dialogs, this shouldn't really be the stumbling block. So I decided my first task was coding the .NET replacements for IXPLogon, IXPProvider, and IMAPIStatus. This is where I get confused, and Microsofts reference turns me round and round in a circular mess until I am confused. Thus far, I get to the following code, which I think is right
using System; using System.Runtime.InteropServices; namespace MAPI.Extended { [Guid("insert-my-generated-guid-here")] interface IXPLogon { // HRESULT TransportLogon(ULONG FAR *lpulFlags); void Shutdown(UInt32 lpulFlags); // HRESULT TransportLogon( // LPMAPISUP lpMAPISup, // ULONG ulUIParam, // LPTSTR lpszProfileName, // ULONG FAR * lpulFlags, // LPMAPIERROR FAR *lppMAPIError, // LPXPLOGON FAR * lppXPLogon); } }
Now, this last one has me more than a little concerned, but I figure that if I can work this one out, then I am in good shape for the other ones. The MSDN documentation says ULONG becomes a UInt32, LPTSTR becomes a String - this is fairly easy. LPMAPISUP is a pointer to an object which implements IMAPISupport. Thus, I figure I can replace that with IMAPISupport lpMAPISup possi -
Icons in Installer (driving me nuts)Yep - thats what I did the first time (the application Icon App.ico which is embedded into the executable) - that didn't work for me. Alternative - are there any alternate setup/installer systems out there that integrate with VS.NET IDE? -Adrian
-
Icons in Installer (driving me nuts)I am packaging my application for distribution. One of the items I have on the To-do list is to put a shortcut in the Start menu with a particular icon. I started an Installer project, right clicked on the project and chose View->File System. I selected the "User's Programs Menu" and created a folder. I then created a shortcut from my Application Folder/Primary output from ... and placed it in this folder. Now comes the bit which doesn't work. I right clicked on the shortcut I had created, and selected Properties Window. This has an "Icon" item. I want to change the Icon so that it looks like my program. So I browse and select the App icon inside my Primary output file. Build/install and I get the default icon look - not my custom icon. Hmmm - I thought - why don't I add a .ico file with the appropriate icon in it, and point the icon at that. So I uninstall the previous version, alter the icon, build/install and I get the same default icon look. Can someone please explain how I can make my installed shortcut have my desired icon? -Adrian
-
Web Service QuestionIts definately possible (I wrote something similar in Perl with SOAP::Lite). In fact, it won't even be that hard. In C#, create a Web service, and then just use a WebRequest/WebResponse object to get the file (I hope you don't need to use HTTP POST to get your files!) and then serialize it and return it. -Adrian
-
textBox -to- Binary RegistryHey Jassim, The Text is stored within textbox.Text property. Look in the C# articles for "QuickRegistry" and use that for storage. -Adrian