Thanks, that's exactly what I needed! I have also found another way to do it. System::Runtime::InteropServices::Marhshal::GetObjectForIUnknown
This wrap's a COM object into a managed Object and apparently also supports wrapping late binding dispatch calls. Cheers -----Original Message----- From: Discussion of advanced .NET topics. [mailto:[EMAIL PROTECTED] On Behalf Of Jim Sievert Sent: 12 April 2007 16:10 To: [EMAIL PROTECTED] Subject: Re: [ADVANCED-DOTNET] C++/CLI - Late Binding Call Wrapper Implementing IReflect allows you to get control over IDispatch calls. > -----Original Message----- > From: Discussion of advanced .NET topics. [mailto:ADVANCED- > [EMAIL PROTECTED] On Behalf Of Kevin Palmer > Sent: Thursday, April 12, 2007 9:18 AM > To: [EMAIL PROTECTED] > Subject: [ADVANCED-DOTNET] C++/CLI - Late Binding Call Wrapper > > Hi All, > > I am developing a Managed C++/CLI DLL which is being used as a layer > between our COM based application and a .NET assembly. We are not > using interop as we wanted to simplify our API's when calling down to > the .NET component so we are doing the marshalling ourselves. > > I am having a problem however coming up with a way to write a late > binding call wrapper .NET class which will wrap an IDispatch object. > > We have succeeded in doing it the other way round (i.e. We've got a > COM object where we've implemented IDispatch to make calls to the > contained .NET object's InvokeMember method) and this works fine. > > Basically what we need is to obtain an IDispatch* pointer for the .NET > object. > > In MSDN it suggests that InvokeMember is overridable but i cannot > fingure out how you would override it. How would you get the object to > pass out your Type object instead of the .NET generated one? > > Any help would be appreciated, > > Thanks, > > Kevin. > > -- > Sorry if you'd already received this message but i didn't get a > confirmation so i'm trying it via the web interface. Cheers. > > =================================== > This list is hosted by DevelopMentor(r) http://www.develop.com > > View archives and manage your subscription(s) at > http://discuss.develop.com =================================== This list is hosted by DevelopMentor(r) http://www.develop.com View archives and manage your subscription(s) at http://discuss.develop.com =================================== This list is hosted by DevelopMentorĀ® http://www.develop.com View archives and manage your subscription(s) at http://discuss.develop.com
