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 / March 2008

Tip: Looking for answers? Try searching our database.

Implementing Standart Com interface

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
pokemon - 20 Mar 2008 15:04 GMT
Hi,

I've looked all around but couldn't find any practical information on about
how to implement a standart COM interface from managed code (I want to
implement IFilterMessage Interface in my C# code)...

What are the steps to follow ?
Adam - 30 Mar 2008 06:51 GMT
pokemon,

Assuming you have the interface defined as a ComImport in .NET, you can
implement it just like a .NET interface.

If you don't have the ComImport interface already (via an interop assembly
or some other .NET assembly), then either create an interop assembly from the
COM DLL or look at the interface definition in the IDL and manually create a
.NET interface that mimics it, something like this:

[ComImport]
[Guid("GUID_OF_INTERFACE")]
public interface IMyInterface
{
   // Returns HRESULT
   int Function1([In] int param1, [Out] out int param2);
}

Then implement it as a normal .NET interface.

Hope this helps.

Adam

> Hi,
>
[quoted text clipped - 3 lines]
>
> What are the steps to follow ?

Rate this thread:







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.