Click here to Skip to main content
15,895,423 members
Home / Discussions / C#
   

C#

 
GeneralRe: Exception from HRESULT: 0x80131019 Pin
Zombies with Coffee, LLC7-Mar-03 18:16
professionalZombies with Coffee, LLC7-Mar-03 18:16 
GeneralRe: Exception from HRESULT: 0x80131019 Pin
Zombies with Coffee, LLC7-Mar-03 18:22
professionalZombies with Coffee, LLC7-Mar-03 18:22 
GeneralMigration from VB6 Pin
Mark Sanders7-Mar-03 10:08
Mark Sanders7-Mar-03 10:08 
GeneralRe: Migration from VB6 Pin
Paul Riley7-Mar-03 10:42
Paul Riley7-Mar-03 10:42 
QuestionHow di I add a "Send To..." item Pin
Adrian Hall7-Mar-03 8:52
Adrian Hall7-Mar-03 8:52 
AnswerRe: How di I add a "Send To..." item Pin
Stephane Rodriguez.7-Mar-03 9:51
Stephane Rodriguez.7-Mar-03 9:51 
GeneralRe: How di I add a "Send To..." item Pin
Adrian Hall7-Mar-03 10:41
Adrian Hall7-Mar-03 10:41 
GeneralRe: How di I add a "Send To..." item Pin
Stephane Rodriguez.7-Mar-03 11:26
Stephane Rodriguez.7-Mar-03 11:26 
I thought there were interesting stuff in the code itself, but anyway. A SendTo handler is a COM object which implements the IDropHandler interface.
Mike dunn has written an article[^] about how to do this using C++/ATL.
Now for C#, the basic start is to implement the IDropHandler interface using the appropriate attributes. A good start is COMInteropPart2\CSharpServer from the VS.NET sample cds. It goes like this :
// CSharpServer.cs
// compile with: /target:library
// post-build command: regasm CSharpServer.dll /tlb:CSharpServer.tlb

using System;
using System.Runtime.InteropServices;
namespace CSharpServer
{
   // Since the .NET Framework interface and coclass have to behave as 
   // COM objects, we have to give them guids.
   [Guid("DBE0E8C4-1C61-41f3-B6A4-4E2F353D3D05")]
   public interface IManagedInterface
   {
      int PrintHi(string name);
   }

   [Guid("C6659361-1625-4746-931C-36014B146679")]
   public class InterfaceImplementation : IManagedInterface
   {
      public int PrintHi(string name)
      {
         Console.WriteLine("Hello, {0}!", name);
         return 33;
      }
   }
}

QuestionHow can I field Win32 callbacks like EnumChildWindows? Pin
Mattingly7-Mar-03 7:54
Mattingly7-Mar-03 7:54 
AnswerRe: How can I field Win32 callbacks like EnumChildWindows? Pin
leppie7-Mar-03 8:46
leppie7-Mar-03 8:46 
GeneralRe: How can I field Win32 callbacks like EnumChildWindows? Pin
Mattingly7-Mar-03 9:20
Mattingly7-Mar-03 9:20 
Generalcalling gpg.exe from a console app Pin
zamoranelson7-Mar-03 5:41
zamoranelson7-Mar-03 5:41 
GeneralRe: calling gpg.exe from a console app Pin
Baris Kurtlutepe7-Mar-03 17:06
Baris Kurtlutepe7-Mar-03 17:06 
GeneralInvoking Methods by name Pin
Jon Newman7-Mar-03 4:10
Jon Newman7-Mar-03 4:10 
GeneralRe: Invoking Methods by name Pin
Jon Newman7-Mar-03 4:28
Jon Newman7-Mar-03 4:28 
GeneralRe: Invoking Methods by name Pin
Paresh Gheewala7-Mar-03 10:41
Paresh Gheewala7-Mar-03 10:41 
GeneralShort Q: How to close a Console App and exit the program Pin
Schmidt__7-Mar-03 3:16
sussSchmidt__7-Mar-03 3:16 
GeneralRe: Short Q: How to close a Console App and exit the program Pin
Paul Riley7-Mar-03 3:18
Paul Riley7-Mar-03 3:18 
GeneralRe: Short Q: How to close a Console App and exit the program Pin
Nish Nishant7-Mar-03 3:20
sitebuilderNish Nishant7-Mar-03 3:20 
GeneralRe: Short Q: How to close a Console App and exit the program Pin
Paul Riley7-Mar-03 4:47
Paul Riley7-Mar-03 4:47 
GeneralRe: Short Q: How to close a Console App and exit the program Pin
Paresh Gheewala7-Mar-03 10:39
Paresh Gheewala7-Mar-03 10:39 
GeneralShort timezone names Pin
gercules7-Mar-03 3:10
gercules7-Mar-03 3:10 
QuestionHow to Paste Metafile(GIF) from EXCEL Pin
tzn6-Mar-03 23:31
tzn6-Mar-03 23:31 
Generalwriting a ad blocker: help needed! Pin
viperxp6-Mar-03 22:47
viperxp6-Mar-03 22:47 
GeneralRe: writing a ad blocker: help needed! Pin
Stephane Rodriguez.7-Mar-03 0:59
Stephane Rodriguez.7-Mar-03 0:59 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.