Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Interop / August 2003

Tip: Looking for answers? Try searching our database.

Substitute for marshalling interfaces

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Daniel Weber - 25 Aug 2003 12:38 GMT
Hi there.

A method of my implementation of a COM interface takes an interface as
parameter, which I never use. I could save the code for the definition of
that interface, but what would be a substitute for that parameter ?? Maybe
IntPtr ??

Thanks

Daniel
Christian Fröschlin - 25 Aug 2003 13:32 GMT
> A method of my implementation of a COM interface takes an interface
> as parameter, which I never use. I could save the code for the
> definition of that interface, but what would be a substitute for
> that parameter ?? Maybe IntPtr ??

I suppose "Object" would be more adequate.
David Stucki [MS] - 25 Aug 2003 23:12 GMT
If you use Object you want to use the [MarshalAs(UnmanagedType.Interface)]
or [MarshalAs(UnmanagedType.IUnknown)] otherwise the framework will
interpret that parameter as a VARIANT which would be incorrect.  IntPtr
will also work just fine.  If you're not going to use this IntPtr would be
the quick and easy way to go.

David Stucki
Microsoft Developer Support

This posting is provided "AS IS" with no warranties, and confers no rights.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.