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 / Languages / C# / November 2007

Tip: Looking for answers? Try searching our database.

Create .NET Interface definitions for COM

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Bogey - 14 Nov 2007 02:19 GMT
I am trying to implement the interfaces (well, actually create the COM
Interop interface definitions first), but am unsure how to create the
interface.cs files needed.

The interfaces in particular I need right now are IE7 interfaces
IInternetSecurityManagerEx and IInternetSecurityManagerEx2.

I found that IInternetSecurityManagerEx is defined in the IDL file for
UrlMon.IDL - so is there an automated mechanism for creating the many
CS assembly files for a particular interface?

IInternetSecurityManagerEx2 seems to only be defined on MSDN and I
can't find the C# code for the interface definition...
Nicholas Paldino [.NET/C# MVP] - 14 Nov 2007 02:40 GMT
Bogey,

   You could use the MIDL compiler and compile the IDL file into a type
library, and then use TLBIMP to import the definition.  However, I think
doing it by hand is a better idea.  These definitions look pretty simple, so
I would recommend creating them by hand as well.

   You might want to check out the section of the MSDN documentation titled
"Exposing COM Components to the .NET Framework  ", located at:

http://msdn2.microsoft.com/en-us/library/z6tx9dw3(VS.80).aspx

   To help you with creating the definitions of the interfaces in code.

Signature

         - Nicholas Paldino [.NET/C# MVP]
         - mvp@spam.guard.caspershouse.com

>I am trying to implement the interfaces (well, actually create the COM
> Interop interface definitions first), but am unsure how to create the
[quoted text clipped - 9 lines]
> IInternetSecurityManagerEx2 seems to only be defined on MSDN and I
> can't find the C# code for the interface definition...
Bogey - 14 Nov 2007 21:34 GMT
Trouble with the interfaces I'm particularly interested in, is that
running MIDL on UrlMon.IDL does not generate a TLB (even using the TLB
option). I was hoping for a less manual approach.

I had already Google'd that reference you mentioned, but thanks
nonetheless.

There's also the problem that I can't even find the documentation (or
the GUID) for IInternetSecurityManagerEx2. In the online docs, it
talks about using SID_IInternetSecurityManagerEx2 in QueryService, but
I can't actually find a definition for that constant.

tonyB.

On Nov 13, 6:40 pm, "Nicholas Paldino [.NET/C# MVP]"
<m...@spam.guard.caspershouse.com> wrote:
>     You could use the MIDL compiler and compile the IDL file into a type
> library, and then use TLBIMP to import the definition.  However, I think
> doing it by hand is a better idea.  These definitions look pretty simple, so
> I would recommend creating them by hand as well.
Bogey - 14 Nov 2007 21:34 GMT
Trouble with the interfaces I'm particularly interested in, is that
running MIDL on UrlMon.IDL does not generate a TLB (even using the TLB
option). I was hoping for a less manual approach.

I had already Google'd that reference you mentioned, but thanks
nonetheless.

There's also the problem that I can't even find the documentation (or
the GUID) for IInternetSecurityManagerEx2. In the online docs, it
talks about using SID_IInternetSecurityManagerEx2 in QueryService, but
I can't actually find a definition for that constant.

tonyB.

On Nov 13, 6:40 pm, "Nicholas Paldino [.NET/C# MVP]"
<m...@spam.guard.caspershouse.com> wrote:
>     You could use the MIDL compiler and compile the IDL file into a type
> library, and then use TLBIMP to import the definition.  However, I think
> doing it by hand is a better idea.  These definitions look pretty simple, so
> I would recommend creating them by hand as well.
Bogey - 14 Nov 2007 22:07 GMT
Trouble with the interfaces I'm particularly interested in, is that
running MIDL on UrlMon.IDL does not generate a TLB (even using the TLB
option). I was hoping for a less manual approach.

I had already Google'd that reference you mentioned, but thanks
nonetheless.

There's also the problem that I can't even find the documentation (or
the GUID) for IInternetSecurityManagerEx2. In the online docs, it
talks about using SID_IInternetSecurityManagerEx2 in QueryService, but
I can't actually find a definition for that constant.

tonyB.

On Nov 13, 6:40 pm, "Nicholas Paldino [.NET/C# MVP]"
<m...@spam.guard.caspershouse.com> wrote:
>     You could use the MIDL compiler and compile the IDL file into a type
> library, and then use TLBIMP to import the definition.  However, I think
> doing it by hand is a better idea.  These definitions look pretty simple, so
> I would recommend creating them by hand as well.

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.