Click here to Skip to main content
15,920,602 members
Home / Discussions / C#
   

C#

 
GeneralRe: Returning a String from Managed to Unmanaged Code Pin
SanShou8-Jul-04 8:57
SanShou8-Jul-04 8:57 
Generalmicrosoft.office.interop Pin
dcronje8-Jul-04 5:49
dcronje8-Jul-04 5:49 
GeneralRe: microsoft.office.interop Pin
Heath Stewart8-Jul-04 8:28
protectorHeath Stewart8-Jul-04 8:28 
GeneralIDragSourceHelper problem Pin
TylerBrinks8-Jul-04 4:17
TylerBrinks8-Jul-04 4:17 
GeneralRe: IDragSourceHelper problem Pin
Heath Stewart8-Jul-04 5:28
protectorHeath Stewart8-Jul-04 5:28 
GeneralRe: IDragSourceHelper problem Pin
TylerBrinks8-Jul-04 5:52
TylerBrinks8-Jul-04 5:52 
GeneralRe: IDragSourceHelper problem Pin
Heath Stewart8-Jul-04 6:43
protectorHeath Stewart8-Jul-04 6:43 
GeneralRe: IDragSourceHelper problem Pin
Heath Stewart8-Jul-04 6:53
protectorHeath Stewart8-Jul-04 6:53 
I three together the follow. The ComImportAttribute changes the metadata such that an instance is marked as imported and created from the attributed GUID. By casting, I am effectively QI'ing for the two interfaces.

In both cases, "False" is printed to the console, showing that the object does implement both interfaces. Sorry I don't have time to throw together a better sample (and keep in mind that when using interfaces not every method has to be defined (so long as they're in the correct VTBL order):
using System;
using System.Runtime.InteropServices;

[
  GuidAttribute("4657278A-411B-11d2-839A-00C04FD918D0"),
  ClassInterface(ClassInterfaceType.None),
  ComImport
]
public class DragDropHelper : IDropTargetHelper, IDragSourceHelper
{
}

[
  GuidAttribute("4657278B-411B-11d2-839A-00C04FD918D0"),
  InterfaceType(ComInterfaceType.InterfaceIsIUnknown),
  ComImport
]
public interface IDropTargetHelper
{
}

[
  GuidAttribute("DE5BF786-477A-11d2-839D-00C04FD918D0"),
  InterfaceType(ComInterfaceType.InterfaceIsIUnknown),
  ComImport
]
public interface IDragSourceHelper
{
}

class Test
{
  static void Main()
  {
    DragDropHelper helper = new DragDropHelper();

    IDropTargetHelper dropHelper = (IDropTargetHelper)helper;
    IDragSourceHelper dragHelper = (IDragSourceHelper)helper;

    Console.WriteLine(dropHelper == null);
    Console.WriteLine(dragHelper == null);
  }
}


 

Microsoft MVP, Visual C#
My Articles
GeneralForm display porblem Pin
wk_vigorous8-Jul-04 1:52
wk_vigorous8-Jul-04 1:52 
GeneralRe: Form display porblem Pin
Nick Parker8-Jul-04 3:43
protectorNick Parker8-Jul-04 3:43 
GeneralRe: Form display porblem Pin
wk_vigorous8-Jul-04 4:43
wk_vigorous8-Jul-04 4:43 
GeneralRe: Form display porblem Pin
Heath Stewart8-Jul-04 5:21
protectorHeath Stewart8-Jul-04 5:21 
GeneralSelection in datagrid gets really slow Pin
Atlemann8-Jul-04 1:02
Atlemann8-Jul-04 1:02 
Generalstring==C#?YES:NO Pin
saud_a_k7-Jul-04 22:49
saud_a_k7-Jul-04 22:49 
GeneralRe: string==C#?YES:NO Pin
SJ_Phoenix8-Jul-04 0:13
SJ_Phoenix8-Jul-04 0:13 
GeneralRe: string==C#?YES:NO Pin
Nick Parker8-Jul-04 1:37
protectorNick Parker8-Jul-04 1:37 
GeneralRe: string==C#?YES:NO Pin
Heath Stewart8-Jul-04 5:02
protectorHeath Stewart8-Jul-04 5:02 
GeneralRe: string==C#?YES:NO Pin
Grimolfr8-Jul-04 9:01
Grimolfr8-Jul-04 9:01 
GeneralRe: string==C#?YES:NO Pin
leppie8-Jul-04 9:35
leppie8-Jul-04 9:35 
GeneralRe: string==C#?YES:NO Pin
saud_a_k8-Jul-04 19:28
saud_a_k8-Jul-04 19:28 
GeneralRe: string==C#?YES:NO Pin
leppie8-Jul-04 9:37
leppie8-Jul-04 9:37 
GeneralRe: string==C#?YES:NO Pin
saud_a_k8-Jul-04 19:32
saud_a_k8-Jul-04 19:32 
GeneralRe: string==C#?YES:NO Pin
leppie9-Jul-04 7:06
leppie9-Jul-04 7:06 
GeneralRe: string==C#?YES:NO Pin
saud_a_k12-Jul-04 18:36
saud_a_k12-Jul-04 18:36 
GeneralQuestion about NavigationGraph in UIPAB Pin
Phoenixcp7-Jul-04 21:52
Phoenixcp7-Jul-04 21:52 

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.