Click here to Skip to main content
15,923,273 members
Home / Discussions / C#
   

C#

 
GeneralRe: Unhandled exception Pin
Kevin McFarlane2-Feb-06 6:33
Kevin McFarlane2-Feb-06 6:33 
GeneralRe: Unhandled exception Pin
joly_12-Feb-06 7:11
joly_12-Feb-06 7:11 
GeneralRe: Unhandled exception Pin
User 66582-Feb-06 6:45
User 66582-Feb-06 6:45 
GeneralRe: Unhandled exception Pin
joly_12-Feb-06 7:47
joly_12-Feb-06 7:47 
QuestionWriting Text File Pin
Greeky2-Feb-06 4:04
Greeky2-Feb-06 4:04 
AnswerRe: Writing Text File Pin
Sebastian Schneider2-Feb-06 4:42
Sebastian Schneider2-Feb-06 4:42 
AnswerRe: Writing Text File Pin
Dave Kreskowiak2-Feb-06 7:10
mveDave Kreskowiak2-Feb-06 7:10 
QuestionMarshling Across Thread boundries Pin
thayat2-Feb-06 2:31
thayat2-Feb-06 2:31 
I have got the client site pointer in C# using

Type typeIOleObject = this.GetType().GetInterface("IOleObject", true);
//call the method on that interface
oleClientSite = typeIOleObject.InvokeMembe("GetClientSite",
BindingFlags.Instance|BindingFlags.InvokeMethod|BindingFlags.Public,null, this, null);
where this is System.Windows.Forms.UserControl

now i want to marshal that object oleClientSite to send it to another thread.
in C++ we use CoMarshalInterThreadInterfaceInStream to convert that interface to stream and send that stream to another thread where we call CoGetInterfaceAndReleaseStream to get interface pointer from that stream.

i want the alternative for that in C#, that how can i marshal that interface and get that in the other thread.

one way is to use win32 API in C# but i am getting error using this in C#.

HRESULT CoMarshalInterThreadInterfaceInStream(IN REFIID riid, IN LPUNKNOWN pUnk,OUT LPSTREAM *ppStm);

in C# i have used this as
[DllImport("Ole32.dll")]
public static extern IntPtr CoMarshalInterThreadInterfaceInStream(
Guid riid,
[MarshalAs(UnmanagedType.IUnknown)]
object pUnk,
out object ppStm);

but it returns the error code -2147024809 which means that "The parameter is incorrect".

can someone plz tell me whats the alternate for CoMarshalInterThreadInterfaceInStream and
CoGetInterfaceAndReleaseStream in C#
or how can i make that dllimport call correct

thanx in advance.

QuestionVisual Inheritance Context Menu Bug? Pin
Soundman32.22-Feb-06 2:13
Soundman32.22-Feb-06 2:13 
Questionoutlook addin in c# Pin
SamuelF2-Feb-06 1:54
SamuelF2-Feb-06 1:54 
Questionautostart c# winApp upon system boot Pin
batmanAgen2-Feb-06 1:00
batmanAgen2-Feb-06 1:00 
AnswerRe: autostart c# winApp upon system boot Pin
Vasudevan Deepak Kumar2-Feb-06 1:26
Vasudevan Deepak Kumar2-Feb-06 1:26 
GeneralRe: autostart c# winApp upon system boot Pin
batmanAgen2-Feb-06 1:32
batmanAgen2-Feb-06 1:32 
GeneralRe: autostart c# winApp upon system boot Pin
mav.northwind2-Feb-06 1:37
mav.northwind2-Feb-06 1:37 
GeneralRe: autostart c# winApp upon system boot Pin
engsrini2-Feb-06 1:53
engsrini2-Feb-06 1:53 
GeneralRe: autostart c# winApp upon system boot Pin
mav.northwind2-Feb-06 2:11
mav.northwind2-Feb-06 2:11 
GeneralRe: autostart c# winApp upon system boot Pin
malharone2-Feb-06 6:13
malharone2-Feb-06 6:13 
JokeRe: autostart c# winApp upon system boot Pin
Daniel Grunwald2-Feb-06 7:13
Daniel Grunwald2-Feb-06 7:13 
GeneralRe: autostart c# winApp upon system boot Pin
Dan Neely3-Feb-06 2:20
Dan Neely3-Feb-06 2:20 
AnswerRe: autostart c# winApp upon system boot Pin
drc_no12-Feb-06 6:30
drc_no12-Feb-06 6:30 
GeneralRe: autostart c# winApp upon system boot Pin
Dave Kreskowiak2-Feb-06 7:08
mveDave Kreskowiak2-Feb-06 7:08 
GeneralRe: autostart c# winApp upon system boot Pin
drc_no12-Feb-06 8:21
drc_no12-Feb-06 8:21 
Questionabout timer Pin
shazzney1-Feb-06 22:46
shazzney1-Feb-06 22:46 
AnswerRe: about timer Pin
Dave Kreskowiak2-Feb-06 5:41
mveDave Kreskowiak2-Feb-06 5:41 
QuestionTransferring Application Log to a file Pin
engsrini1-Feb-06 22:07
engsrini1-Feb-06 22:07 

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.