Click here to Skip to main content
15,922,584 members
Home / Discussions / C#
   

C#

 
GeneralRe: c# Pin
Pete O'Hanlon15-Aug-07 4:42
mvePete O'Hanlon15-Aug-07 4:42 
GeneralRe: c# Pin
Paul Conrad18-Aug-07 6:27
professionalPaul Conrad18-Aug-07 6:27 
AnswerRe: c# Pin
Colin Angus Mackay15-Aug-07 4:46
Colin Angus Mackay15-Aug-07 4:46 
GeneralRe: c# Pin
Justin Perez15-Aug-07 4:55
Justin Perez15-Aug-07 4:55 
GeneralRe: c# Pin
Colin Angus Mackay15-Aug-07 5:16
Colin Angus Mackay15-Aug-07 5:16 
GeneralRe: c# Pin
Justin Perez15-Aug-07 5:29
Justin Perez15-Aug-07 5:29 
AnswerRe: c# Pin
Baconbutty15-Aug-07 4:53
Baconbutty15-Aug-07 4:53 
AnswerGO AWAY Pin
leckey15-Aug-07 6:17
leckey15-Aug-07 6:17 
Question.NET Charts Control Pin
Fouad_kayali15-Aug-07 4:23
Fouad_kayali15-Aug-07 4:23 
AnswerRe: .NET Charts Control Pin
Judah Gabriel Himango15-Aug-07 4:26
sponsorJudah Gabriel Himango15-Aug-07 4:26 
Questionc# Pin
lankaudaranga15-Aug-07 4:15
lankaudaranga15-Aug-07 4:15 
AnswerRe: c# Pin
Colin Angus Mackay15-Aug-07 4:17
Colin Angus Mackay15-Aug-07 4:17 
AnswerRe: c# Pin
Justin Perez15-Aug-07 4:18
Justin Perez15-Aug-07 4:18 
AnswerRe: c# Pin
Scott Dorman15-Aug-07 4:21
professionalScott Dorman15-Aug-07 4:21 
Questionc# Pin
lankaudaranga15-Aug-07 4:12
lankaudaranga15-Aug-07 4:12 
AnswerRe: c# Pin
Scott Dorman15-Aug-07 4:16
professionalScott Dorman15-Aug-07 4:16 
AnswerRe: c# Pin
Colin Angus Mackay15-Aug-07 4:19
Colin Angus Mackay15-Aug-07 4:19 
GeneralRe: c# Pin
Scott Dorman15-Aug-07 4:21
professionalScott Dorman15-Aug-07 4:21 
GeneralRe: c# Pin
Justin Perez15-Aug-07 4:22
Justin Perez15-Aug-07 4:22 
GeneralRe: c# Pin
Bert delaVega15-Aug-07 5:39
Bert delaVega15-Aug-07 5:39 
GeneralRe: c# Pin
Justin Perez15-Aug-07 5:43
Justin Perez15-Aug-07 5:43 
QuestionInvalidCastException for interface Pin
__DanC__15-Aug-07 3:54
__DanC__15-Aug-07 3:54 
AnswerRe: InvalidCastException for interface Pin
Justin Perez15-Aug-07 3:57
Justin Perez15-Aug-07 3:57 
AnswerRe: InvalidCastException for interface Pin
Scott Dorman15-Aug-07 4:14
professionalScott Dorman15-Aug-07 4:14 
GeneralRe: InvalidCastException for interface Pin
__DanC__15-Aug-07 4:43
__DanC__15-Aug-07 4:43 
I should have been more clear. The interface is IShellFolder, it is defined in both assemblies as a ComImport

[ComImport, Guid("000214E6-0000-0000-C000-000000000046"),<br />
    InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]


The problem is the the signatures are different, for example:

<br />
int BindToObject(IntPtr pidl, [In] IntPtr pbc, [In] ref Guid riid, [Out] out IntPtr ppv);<br />


and

<br />
int BindToObject(IntPtr pidl, [In] IntPtr pbc, [In] ref Guid riid, [Out, MarshalAs(UnmanagedType.Interface)] out IShellFolder ppv);<br />


When I call IShellFolder.BindToObject on from one assembly to the other I get a valid IntPtr but when I cast it using Marshal.GetObjectForIUnknown I get an error saying "Specified cast is not valid"


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.